Answer the question
In order to leave comments, you need to log in
How to combine multiple commands in htaccess?
Hello. How can I combine 2 commands into 1 file?
1. Remove .html and URLs
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^\.]+)\.p?html?$ http://wot-shop.icu/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
2. Редирект на https
RewriteEngine On
RewriteCond %{HTTPS} =off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [QSA,L]
Answer the question
In order to leave comments, you need to log in
RewriteEngine On
RewriteCond %{THE_REQUEST} ^\S+\s+/([^.?]+)\.html
RewriteRule ^ https://wot-shop.icu/%1 [R=301,L]
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://wot-shop.icu/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^\.]+)\.p?html?$ https://site.ru/wot-shop.icu/$1 [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question