RW theme content not allowing redirect

I have 2 sites hosted by Hostgator. Neither redirects or changes to the .htaccess file allowed a redirect to work. Was able to talk to a serious techie and he gave valuable info. First, both sites are from different developers, multithemes and nick cates. They both tested with the same problem. The following is directly from the techie. He said “tested apache on execution of redirect. It works fine. However, upon reaching the website, a redirection loop starts. Possibly something in the stylesheet or theme is causing a redirect loop. The issue is coding versus Apache. To restate, somewhere in the file is something stating what the url should be and it’s over riding the apache redirect”.

Since the issue is with 2 different themes from 2 different developers, any RW techies out there with any ideas how to fix???

Thank you

I doubt this is a theme issue.

Do you some example sites?

I had a client/site using Hostgator and the support was awful and in my opinion their business practices questionable. First thing I would do is change hosts. That’s simply my own personal opinion.

Having said that… is the htaccess file working at all? You can create (code) your own simple html page and then enter a redirect to it for example. Or even redirect to an image on your site and see what you get. This would eliminate any type of problem with RW code.

Posting the line of code you are putting in your htaccess file would help…

First off the serious techie you talked with doesn’t sound like they have a clue. Stylesheets (CSS) technically can’t even do redirects. You tested with two different sites using two different themes so that eliminates a theme doing it.
You can have a redirect loop. That can happen within a single or multiple htaccess file(s). There’s other ways to do redirects outside an htaccess file both inside Apache and outside Apache. 301 permanent redirects can be cached for quite awhile, technically forever as they have no expiry date.

  • Can post your htaccess file
  • Need URL’s to the sites
  • Did you do anything else to redirect like cPannel?
  • Did you attempt to change htaccess file and make changes and try again(cache issue)?

Thanks Doug. Sorry to take long to reply – dealing with serious family issues. To answer your questions:

  1. htaccess file - apparently no redirect because Hostgator techie attempted it and the “loop” was still there. Here are the contents of that file: #Redirect 301 /
    That’s all thats there.

  2. url to main site. I uploaded an https version of the site. Though http does not exist anymore, a Google search for “mystery shopping business” and click thru to my site, still lands one on http site (shows as insecure). url is (the second site is

  3. I tried a redirect from http to https from cpanel (domains - redirects). Message that came up was:
    There was an error adding the redirect.
    You cannot redirect “” to “” as this will cause a redirection loop because “/home2/sharijos/public_html/” is at the same place as “/home2/sharijos/public_html/”

  4. I did not attempt to change the htaccess file, but 2 different techies at Hostgator did attempt, and the loop was there.

I hope this helps – all your thoughts appreciated!!!


Thanks Jannis. Sites are (google search shows an insecure http). and (have not uploaded the https version yet)

Thanks Greg - see my answers to Doug’s questions. Appreciate everyone’s input!

#Redirect 301 /

If this is what’s in your .htaccess file then it’s not doing anything as it sits. The # at start makes it a comment.
It’s a totally invalid directive (if un-commented out) and could be the cause of the problem. I don’t know where it came from but it’s the type of redirect that would be used for a single page, but is missing the from page.

I’m not sure why you mentioned the second site?

Anyway I would replace what’s in the .htaccess file with the following:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 
1 Like

Thanks Doug, I’ll give it a try.

Found the solution. First, you were right about Hostgator Greg. Turns out the second level techie did not know what he was doing. Took Doug’s suggestion and just changed the htaccess file. The only thing is I finally found some info on hostgator and changed it as follows:
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$$1 [R=301,L]
This worked. I also did upload a RW https site. Do not know if this was necessary in this case. Again, I would like to thank the 3 of you for your helpful input!!! Grateful to this community.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.