Answer the question
In order to leave comments, you need to log in
How to set up an http to https redirect?
Options +FollowSymlinks
Options -Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*) index.php [QSA,L]
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteCond %{REMOTE_HOST} !^xxx\.xxx\.xxx\.xxx
Answer the question
In order to leave comments, you need to log in
RewriteCond %{REMOTE_HOST} !^xxx\.xxx\.xxx\.xxx - what is this? Tipo so that if you enter by IP was a redirect to the domain?
Try like this:
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTP_HOST} !^mysite.ru$ [NC]
RewriteRule ^(.*)$ https://mysite.ru/$1 [L,R=301]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question