Created
December 6, 2016 23:55
-
-
Save leotm/d8a92b9ea8f8bbc7fd260561b8fea524 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Options +FollowSymLinks | |
RewriteEngine on | |
# beautiful addr/location bar | |
RewriteRule ^profile/(.*)/(.*)/?$ profile.php?id=$1&name=$2 [B] | |
# no need to see dem file ext.'s | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME}/index.php !-f | |
RewriteRule ^([^\.]+)$ $1.php [NC,L] | |
# don't touch my git | |
RedirectMatch 404 /\.git | |
# disallow folder snoopin | |
Options All -Indexes | |
ErrorDocument 404 https://example.com/404 | |
RewriteRule ^(http://example.com/)index$ http://example.com/ [R=301,L] | |
RewriteRule ^(http://example.com/)index.php$ http://example.com/ [R=301,L] | |
RewriteRule ^(https://example.com/)index$ https://example.com/ [R=301,L] | |
RewriteRule ^(https://example.com/)index.php$ https://example.com/ [R=301,L] | |
# e.g. inc/ | |
deny from all | |
# best/simple | |
Require local | |
# meh | |
Require ip 127.0.0.1 | |
Require ip ::1 | |
# u old | |
Order deny,allow | |
Deny from all | |
Allow from ::1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment