Answer the question
In order to leave comments, you need to log in
How to setup htaccess for www and http?
Tell me how to configure htaccess to redirect from www to https and from http to https?
I do it like this.
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L,QSA]
#RewriteCond %{HTTP_HOST} ^www.v-son \.ru$ [NC]
#RewriteRule ^(.*)$ v-son.ru/$1 [R=301,L]
#RewriteCond %{SERVER_PORT} ^80$ [OR]
#RewriteCond %{HTTP} =on
# RewriteRule ^(.*)$ https://v-son.ru/$1 [R=301,L]
Link v-son.ru/postelnoe-belyo/all leads to https://v-son.ru/index .php, but should onhttps://v-son.ru/postelnoe-belyo/all
_ parameters after the site name are not accepted.
Answer the question
In order to leave comments, you need to log in
I have it done like this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www(.*)$ [NC]
RewriteRule ^(.*)$ https://domain.ru%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} !^443 $
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question