Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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