Answer the question
In order to leave comments, you need to log in
Need help with htaccess?
Hello. I need to configure .htaccess to do 2 things:
1. Remove .html from the end of links
2. Redirect from http to https
First there was this code:
RewriteEngine On
RewriteCond %{THE_REQUEST} ^\S+\s+/([^.?]+)\.html
RewriteRule ^ https://site.com/%1 [R=301,L]
RewriteCond %{HTTPS} =off [OR]
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteRule (.*) https://site.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html [L]
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question