jasonlally/sanfranciscocode/master/htdocs/.htaccess - Htaccess File

jasonlally/sanfranciscocode/master/htdocs/.htaccess

#Turn off PHP Errors
php_flag display_errors off

# Specify our error pages.
ErrorDocument 404 /404.php

RewriteEngine On
RewriteBase /

### SAMPLE REWRITERULES ###

# Requests for a specific section.
RewriteRule ^(w+.w+-?d*)/$ /law.php?section_number=$1 [QSA]
RewriteRule ^(w+.d+.d+)/$ /law.php?section_number=$1 [QSA]
RewriteRule ^(w+-d+)/$ /law.php?section_number=$1 [QSA]

# Requests for a specific chapter.
#RewriteRule ^(([0-9a-zA-Z]{1,8}/)+)$ /structure.php [QSA]

# Requests for a specific title.
RewriteRule ^([0-9A-Za-z]{1,4})/$ /structure.php?title_number=$1 [QSA]

# Requests for the about page.
RewriteRule ^about/$ /about.php [QSA]

# Requests for the API key registration page.
RewriteRule ^api-key/$ /api-key.php [QSA]

# If this is a request for a plain-text version of a page, translate the extention into a specific
# request.
RewriteRule ^(.*).txt$ /$1/?plain_text=y

On Github License

Files

Download PDF of Htaccess file

Comments

Apache