1 |
8411
|
aaronmk
|
RewriteEngine on
|
2 |
|
|
RewriteOptions AllowNoSlash
|
3 |
|
|
RewriteBase /datasources/
|
4 |
|
|
|
5 |
8444
|
aaronmk
|
SetEnvIf Request_URI ^ innermost_dir=datasources
|
6 |
|
|
|
7 |
8411
|
aaronmk
|
# parse dotpath in the query string
|
8 |
|
|
RewriteCond %{QUERY_STRING} ^(?!&).+$
|
9 |
|
|
RewriteCond %{REQUEST_URI} ^(.*?)(?:/index(?:\.\w+)?)?$
|
10 |
|
|
RewriteRule ^.*$ /dotpath%1 [discardpath,noescape,last]
|
11 |
|
|
|
12 |
|
|
# don't rewrite existing paths
|
13 |
|
|
RewriteCond %{REQUEST_FILENAME} -d [ornext]
|
14 |
|
|
RewriteCond %{REQUEST_FILENAME} -f
|
15 |
|
|
RewriteRule ^(?!/).+$ - [discardpath,noescape,last]
|
16 |
|
|
|
17 |
|
|
# handle DirectoryIndex subrequests
|
18 |
|
|
RewriteRule ^index$() $1 [discardpath,noescape]
|
19 |
|
|
|
20 |
|
|
# dir without trailing / is provided as an absolute filesystem path
|
21 |
8445
|
aaronmk
|
RewriteCond %{ENV:innermost_dir} =datasources
|
22 |
8411
|
aaronmk
|
RewriteRule ^/() $1 [discardpath,noescape,last,redirect]
|