Return to Snippet

Revision: 7512
at July 28, 2008 08:55 by burnsra


Initial Code
<IfModule rewrite_module>
Options +FollowSymLinks
RewriteEngine ON
RewriteLog /Developer/Servers/apache2/logs/mod_rewrite.log
RewriteLogLevel 2

# BlogCFC URL Rewrite Rules
#RewriteRule ^/([A-Za-z0-9-]+)/projects/blog/([\w]+)/index.cfm/(.*)$ /$1/projects/blog/$2/index.cfm?blogParams=$3 [PT,L]
# Blog URL Rewrite Rules
RewriteRule ^/([A-Za-z0-9-]+)/projects/blog/([\w]+)/index.cfm/(.*)$ /$1/projects/blog/$2/index.cfm?blog_param=$3 [R]

RewriteCond %{QUERY_STRING} ^blog_alias=([\w]+)(.*)$ [NC]
RewriteRule ^/([A-Za-z0-9-]+)/projects/(blog[0-9]*)/index\.cfm /$1/projects/$2/%1/?%2 [R]
# If trailing slash is not provided...add trailing slash, and go to default site
RewriteRule ^/([A-Za-z0-9-]+)/projects/(blog[0-9]*)$ /$1/projects/$2/default/ [R]
# If site is not provided...go to default site
RewriteRule ^/([A-Za-z0-9-]+)/projects/(blog[0-9]*)/$ /$1/projects/$2/default/ [R]
# If site is provided, but trailing slash is not provided...add trailing slash, and go to site
RewriteRule ^/([A-Za-z0-9-]+)/projects/(blog[0-9]*)/([\w]+)$ /$1/projects/$2/$3/ [R]
# If loading an include...pass on through
RewriteRule ^/([A-Za-z0-9-]+)/projects/(blog[0-9]*)/([\w]+)/includes/(.*)$ /$1/projects/$2/includes/$4 [QSA,PT,L]
RewriteRule ^/([A-Za-z0-9-]+)/projects/(blog[0-9]*)/([\w]+)/admin/(.*)$ /$1/projects/$2/admin/$4?blog_alias=$3 [QSA,PT,L]
# site is provided, and all is good...pass on through
#RewriteRule ^/([A-Za-z0-9-]+)/(blog[0-9]*)/([\w]+)/(.*)$ /$1/$2/index.cfm?blog_alias=$3 [QSA,PT,L]
RewriteRule ^/([A-Za-z0-9-]+)/projects/(blog[0-9]*)/([\w]+)/(.*)$ /$1/projects/$2/$4?blog_alias=$3 [QSA,PT,L]

# CMS URL Rewrite Rules
RewriteCond %{QUERY_STRING} ^site_alias=([\w]+)(.*)$ [NC]
RewriteRule ^/([A-Za-z0-9-]+)/projects/(cms[0-9]*)/index\.cfm /$1/projects/$2/%1/?%2 [R]
# If trailing slash is not provided...add trailing slash, and go to default site
RewriteRule ^/([A-Za-z0-9-]+)/projects/(cms[0-9]*)$ /$1/projects/$2/default/ [R]
# If site is not provided...go to default site
RewriteRule ^/([A-Za-z0-9-]+)/projects/(cms[0-9]*)/$ /$1/projects/$2/default/ [R]
# If site is provided, but trailing slash is not provided...add trailing slash, and go to site
RewriteRule ^/([A-Za-z0-9-]+)/projects/(cms[0-9]*)/([\w]+)$ /$1/projects/$2/$3/ [R]
# If loading an asset...pass on through
RewriteRule ^/([A-Za-z0-9-]+)/projects/(cms[0-9]*)/([\w]+)/assets/(.*)$ /$1/projects/$2/assets/$4 [QSA,PT,L]
# site is provided, and all is good...pass on through
RewriteRule ^/([A-Za-z0-9-]+)/projects/(cms[0-9]*)/([\w]+)/(.*)$ /$1/projects/$2/index.cfm?site_alias=$3 [QSA,PT,L]
</IfModule>

Initial URL

                                

Initial Description

                                

Initial Title
Apache Rewrite Rules

Initial Tags
url, apache

Initial Language
Apache