Forum Moderators: phranque
Options +FollowSymLinks -MultiViews
RewriteEngine on
#Redirect non-canonical to www
RewriteCond %{HTTP_HOST} !^(www\.mydomain\.fr)?$
RewriteRule (.*) http://www.mydomain.fr/$1 [R=301,L]
RewriteCond %{HTTP} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#Redirect index.html and .htm to folder
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html?\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html?$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)/$ $1.php [L] [edited by: phranque at 9:52 pm (utc) on Nov 1, 2017]
[edit reason] code tags [/edit]
RewriteRule ^(fakedir|otherfake|thirdfake)/(.+)/$ /$1/$2.php [L]OR RewriteCond %{REQUEST_URI} !/(realdir|otherreal|thirdreal)
RewriteRule ^(.+)/$ /$1.php [L]Do not copy-and-paste; I'm making suggestions off the top of my head.