January 25, 20179 yr Hi, I have been given this code by 123 reg to redirect to https but it doesn't seem to be working. myRewriteEngine OnRewriteRule ^apache-redirect-http-to-https\.html$ https://www.urbanjump.co.uk/apache-redirect-http-to-https.html [R=301,L] I have placed this code in my .htaccess file. Any ideas on how to get urbanjump.co.uk and www.urbanjump.co.uk to redirect to https://www.urbanjump.co.uk?
January 26, 20179 yr Author Thank you Nock. I've tried adding it, but got this message, so I have had to remove it: The page isn’t redirecting properlyFirefox has detected that the server is redirecting the request for this address in a way that will never complete.This problem can sometimes be caused by disabling or refusing to accept cookies. This was everything in my .htaccss page:# BEGIN GZIP<ifmodule mod_deflate.c>AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript</ifmodule># END GZIPRewriteEngine OnRewriteCond %{SERVER_PORT} 80RewriteRule ^(.*)$ https://www.urbanjump.co.uk/$1 [R,L] Any ideas? (By the way, Urban Jump is my brothers place, so I hope you have a good time) Edited January 26, 20179 yr by neil0wen
January 26, 20179 yr The port method for some hosts doesn't work, not 100% sure why, it might be worth trying ... RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^(.*)$ https://www.urbanjump.co.uk/$1 [R=301,L] Also added 301 as i'm not sure what's set by default.
January 26, 20179 yr Author Still not working. When I check it on my mobile and click on more details it says: ERR_TOO_MANY_REDIRECTS I don't understand as that is the only code in the .htaccess file. Maybe it's worth going back to 123 reg support. Thanks for your advice anyway Edited January 26, 20179 yr by neil0wen
January 26, 20179 yr I had similar issues with another host where the client was on some cloud host voodoo, dug back through their htaccess and I seen I used X-Forwarded-Proto, something I hadn't used before. RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC] Outside of that I'm at a loss.
January 27, 20179 yr RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com [NC] RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.example.com/$1 [R,L] Note: Replace www.example.com with your actual domain name.
Create an account or sign in to comment