edwardjohnson11/2624432352te2dtw/master/.htaccess - Htaccess File

edwardjohnson11/2624432352te2dtw/master/.htaccess

Options +FollowSymLinks -MultiViews -Indexes

# ---------------------------FORCE non-WWW SSL EXTENSION -------------------------
#must have had allowed override
#must have had enabled mod_rewrite first

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

RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

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

# ---------------------------REMOVING .hTML -------------------------
###removing .html ; requires the options above
#example.com/page will display the contents of example.com/page.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]

#301 from example.com/page.html to example.com/page
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /.*.html HTTP/
RewriteRule ^(.*).html$ /$1 [R=301,L]

On Github License

Files

Download PDF of Htaccess file
HTTP_HOST, REQUEST_FILENAME, REQUEST_URI, THE_REQUEST

Comments

Apache