skip to Main Content

My website is HTML/CSS/JS website with no server (static website) sitting on MS Azure.
I have recently changed 2 of the html files like this:

www.mydomain.com/oldfile1.html

www.mydomain.com/oldfile2.html

To

www.mydomain.com/newfile1.html

www.mydomain.com/newfile2.html

how can I redirect the old url for the sake of SEO, considering the webiste is static and .htaccess doesn’t work and it seems the using meta tag in html file is not considered as 301 permanent redirection?!

2

Answers


  1. Probably not the best answer, but you could change the the html of oldfiles to redirect to the newfiles.

    So something like this:

    <html>
      <head>
        <!--Tells search engines to not index this page-->
        <meta name="robots" content="noindex">
        <!--Redirect to new resource-->
        <meta http-equiv="Refresh" content="0; url=www.mydomain.com/newfile1.html">
      </head>
      <body>
        <!--In case both JavaScript and the meta tag fail-->
        <p>If you aren't automatically redirected please follow<a href="www.mydomain.com/newfile1.html">this link</a>.</p>
        <script>
           //JavaScript fallback if browser does not support/allow http-equiv="Refresh"
           window.location = 'www.mydomain.com/newfile1.html'
        </script>
      </body>
    </html>
    
    Login or Signup to reply.
  2. A 301 Redirect is a server side directive.

    Anything you place in a client side file (<meta> / javascript) cannot be read by the browser until the files arrive in the browser.

    At this point it’s too late to execute a server side directive.

    You’re now pointing the browser at the destination you’re trying to point it away from.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search