All pastes #766149 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-11-08 17:24 UTC
rendered paste body
# error handling [TODO] change /bcp/ to / upon production release
ErrorDocument 400 /bcp/error/400
ErrorDocument 401 /bcp/error/401
ErrorDocument 403 /bcp/error/403
ErrorDocument 404 /bcp/error/404
ErrorDocument 500 /bcp/error/500

# disallow access to dependency directories
Options -Indexes

# index file declaration, useful for disallowing access to the entire site
DirectoryIndex index.inc index.php

# URL Rewrites - thanks Bonus from SA!
# initialize RewriteEngine
Options         +FollowSymLinks
RewriteEngine   On
RewriteBase     /bcp/

# single-level rewrite: for section index pages
RewriteCond     %{REQUEST_FILENAME}     !-f
RewriteCond     %{REQUEST_FILENAME}     !-d
RewriteRule     ^([a-zA-Z0-9\-]+)/?$    /bcp/index.php?s=$1 [L,QSA]

# double-level rewrite (most used): for pages within a section
RewriteCond     %{REQUEST_FILENAME}     !-f
RewriteCond     %{REQUEST_FILENAME}     !-d
RewriteRule     ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$   /bcp/index.php?s=$1&p=$2 [L,QSA]

# triple-level rewrite: for pages with an id variable
#RewriteCond     %{REQUEST_FILENAME}     !-f
#RewriteCond     %{REQUEST_FILENAME}     !-d
#RewriteRule     ^([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-]+)/?$   /index.php?s=$1&p=$2&id=$3 [L,QSA]