0

I added an HTTP meta refresh to my site like this:

<meta http-equiv="refresh" content="0;url=http://mysite.com"> 

but it seems that the browser keeps looping (refreshing) in older Firefox browsers, while in the new version (30.0) it doesn't.

  • 1
    Could you post an url example from where you're redirecting to mysite.com? Is it possible that mysite.com's homepage is also printing the same exact redirect metatag? – Binarysurf Jun 19 '14 at 13:14
  • 1
    Aside: A meta refresh is not a 301 redirect. – MrWhite Jun 19 '14 at 13:17
  • what i am actually trying to do is this. For some reason Google indexed my pages as https. so when user searches for my pages in google search returns show up as mysite.com. So i added code from above into my index.html so when user clicks on google returned (wrongly) mysite.com it will redirect user to mysite.com. This solution worked fine in new version of firefox but not in older ones. – Stribor Jun 19 '14 at 13:18
  • how would i add redirect inside actual html – Stribor Jun 19 '14 at 13:21
  • 1
    The best you can do is to implement server side 301 redirects, these work better for users and for crawlers. What's your website stack? linux/windows? apache/iis/other? Are you able to implement server side redirects? – Binarysurf Jun 19 '14 at 13:27
1

Looping is what I would expect. Likely, the HTTP and HTTPS versions of your page are served from the same document root. This means the same content is served to the visitor regardless of the HTTP protocol.

As a result, when someone visits https://mysite.com they are redirected to http://mysite.com which then redirects them again to http://mysite.com. This creates the loop.

With meta-refresh there is no way to distinguish between HTTP and HTTPS links.

What you want to do is use mod_rewrite as I documented here

Search for my web site returns HTTPS results

  • where do you place that snippet of code?.htacces? – Stribor Jun 19 '14 at 17:22
  • That goes into an htaccess file in your to level directory. – jeffatrackaid Jun 19 '14 at 17:23
  • no....it didnt work.....i added it into top level directory and when i click on one of the google returned results it still does same thing. by the way my .htaccess contain only the code you have in post you suggested above – Stribor Jun 19 '14 at 17:29
  • by the way my web server is not apache ): it is iis – Stribor Jun 19 '14 at 17:41
  • The strategy would be the same -- just different rules. I don't handle IIS admin so don't have a ruleset to recommend. – jeffatrackaid Jun 19 '14 at 17:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.