opengovfoundation/uscode.org/master/htdocs/.htaccess - Htaccess File

opengovfoundation/uscode.org/master/htdocs/.htaccess

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

php_flag display_errors off

RewriteEngine On
RewriteBase /

# Provide an aliased URL to test during setup whether RewriteRule works.
RewriteRule ^index.php.test$ /index.php [QSA]

### SAMPLE REWRITERULES ###

# Requests for a specific law.
#RewriteRule ^([0-9A-Za-z.]{1,4})-([0-9.:]{1,10})/$ /law.php?section_number=$1-$2 [QSA]
RewriteRule ^(d+/d+/)(d+[a-z]?)/$ /law.php?structure_identifier=$1&section_number=$2 [QSA]

# Requests for a specific structural unit.
RewriteRule ^((([0-9A-Za-z.]{1,8})/)+)$ /structure.php [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