I’ve read lots of threads about problems with flushing out a 301 redirect, but this is a bit of an odd one.
I had a 301 set in .htaccess to redirect from https to http. Since then I ended up needing to go back to having the website on https, so I removed the 301. The 301 was in place for maybe a week, then removed a little over 2 weeks ago now.
So at the moment if I go to the website, it sends me to http (even if I specify https). However, when I go to the CMS login page it takes to me https, and remains there whenever I’m in the CMS.
So my question is whether this is a bit of an anomaly and the 301 will eventually disappear and all will be good in the world again, or whether the fact that the CMS goes to https indicates that there could be a problem elsewhere that for some reason is keeping the 301 in place?
Thanks in advance for any suggestions!
Edit: I’ve also been on an online redirect checker, which tells me that there’s a 301 on https (and that http is fine).
Edit: I thought it’d be best if I listed things I’ve tried:
- Tried putting in a redirect in .htaccess to go from http to https, which caused a redirect loop
- Changed the Site Address and WordPress Address in the CMS Settings to https, and changed all links and resources etc to https
- Changed the site address on Google Analytics and Search Console/Webmaster Tools, and submitted a new sitemap on the latter
- I had the WP Super Cache plugin in place, so I deactivated that
- Fully removed cache from browsers, used incognito windows, and tried on different devices which haven’t been on the site before, but the result is the same (https redirects to http apart from in the CMS).
- This appears to be in no way a problem with browser cache – all the evidence so far is pointing towards either the redirect being indexed, or there is something I’ve missed in the website configuration somewhere..
Edit: The problem seems to now be resolved – I’ll keep an eye on it for the day before marking this resolved.
Edit: I’ve moved the explanation of the fix to the Answer
Redirect 301 in the htaccess gets cached in the browser. You’ll have to go through your browser settings and delete your cache. To verify if that is the issue you can use another browser or use browser features such as incognito (in chrome) to see if that redirect is still present.
The issue is now resolved.
I’m not 100% on what solved the issue as I was trying a number of things, but here’s what I tried:
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
Hopefully if anyone comes across a similar problem this will help!