Project

General

Profile

1 7876 aaronmk
#### URL resolution
2
3 7889 aaronmk
DirectorySlash on
4 7949 aaronmk
DirectoryIndex index.php
5 7876 aaronmk
6
### mod_rewrite
7
8 7878 aaronmk
RewriteEngine on
9 7948 aaronmk
RewriteOptions inherit
10 7892 aaronmk
RewriteBase /
11 7876 aaronmk
12 7959 aaronmk
# remove www subdomain
13
RewriteCond %{HTTP_HOST} ^www\.(.*)$
14
RewriteRule ^.*$ http://%1/$0 [redirect]
15
16 7966 aaronmk
# translate subdomain to path prefix
17
RewriteCond %{HTTP_HOST} ^(.+)\.([^.]*\.[^.]*)$
18
RewriteRule ^.*$ http://%2/%1.$0 [redirect]
19
20 7952 aaronmk
# don't rewrite existing paths
21
RewriteCond %{REQUEST_FILENAME} -d [ornext]
22
RewriteCond %{REQUEST_FILENAME} -f [ornext]
23 7957 aaronmk
RewriteCond %{REQUEST_FILENAME} -l
24 7952 aaronmk
RewriteRule ^.*$ - [last]
25
26 7957 aaronmk
# non-filesystem paths
27
ErrorDocument 404 /index.php