.htaccess useful tricks

.htaccess useful tricks

RewriteEngine on

#RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] #RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

#RewriteEngine On

#RewriteCond %{HTTPS} !=on

#RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

ErrorDocument 404 /index.php

#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^([^\.]+)$ $1.php [NC,L]

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php





Leave a Reply