alfo/alexforey.com/master/2011-2015/.htaccess - Htaccess File

alfo/alexforey.com/master/2011-2015/.htaccess

DirectoryIndex index.php index.php building.php

RewriteEngine on
RewriteBase /
 
# remove .php; use THE_REQUEST to prevent infinite loops
RewriteCond %{THE_REQUEST} ^GET (.*).php HTTP
RewriteRule (.*).php$ $1 [R=301]
 
 
# remove index
RewriteRule (.*)/index$ $1/ [R=301]
 
# remove slash if not directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*)/ $1 [R=301]
 
# add .php to access file, but don't redirect
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1.php [L]

ErrorDocument 404 /404.php
<Files 403.sphp>
order allow,deny
allow from all
</Files>

deny from 94.63.9.71
deny from 184.82.186.109
deny from 46.29.252.218
deny from 184.91.50.43
RewriteCond %{HTTP_HOST} ^dev.alexforey.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.dev.alexforey.com$
RewriteRule ^/?$ "http://alex.ntdll.net" [R=301,L]

On Github License

Files

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

Comments

Apache