Redirecting http to https give loop error
I am trying to force my website to redirect to https automatically, but it gives a loop error when I try to do so. I've tried so many different things and nothing is working.
My .htaccess file:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^too\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.too\.com$
RewriteRule ^(.*)$ "https\:\/\/toon\.com\/$1" [R=301,L,NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
DirectoryIndex play
How do I get it to work?
-
I use a php snippet of code and htaccess for my redirect to ) or $_SERVER['HTTPS"> == 'off' ) { $redirect_url = "https://" . $_SERVER['HTTP_HOST"> . $_SERVER['REQUEST_URI">; header("Location: $redirect_url"); exit(); } ?>[/PHP] before i used both of these methods, i tried many methods in htaccess, but i had soo many issues, but now this 2 bits above does the trick for me, maybe it will help you too :) 0
Please sign in to leave a comment.
Comments
3 comments