Project

General

Profile

« Previous | Next » 

Revision 8507

web/**/.htaccess: RewriteRules: ensured flags are in alphabetical order

View differences:

.htaccess
14 14

  
15 15
# remove www subdomain
16 16
RewriteCond %{HTTP_HOST} ^www\.(.*)$
17
RewriteRule ^.*$ %{REQUEST_SCHEME}://%1%{REQUEST_URI} [discardpath,noescape,last,qsappend]
17
RewriteRule ^.*$ %{REQUEST_SCHEME}://%1%{REQUEST_URI} [discardpath,last,noescape,qsappend]
18 18

  
19 19
# remove linewraps used to create a newline for Google spreadsheets
20
RewriteRule ^_-(.*)$ /$1 [discardpath,noescape,last,redirect,qsappend]
20
RewriteRule ^_-(.*)$ /$1 [discardpath,last,noescape,qsappend,redirect]
21 21

  
22 22
## translate subdomain to path
23 23
# set REQUEST_URI_no_extra_/
......
26 26
# translate
27 27
RewriteCond %{HTTP_HOST} !=vegbiendev.nceas.ucsb.edu
28 28
RewriteCond %{HTTP_HOST} ^(.*)\.([^.]*\.[^.]*)$
29
RewriteRule ^.*$ %{REQUEST_SCHEME}://%2/${subdomain2path:%1}%{ENV:REQUEST_URI_no_extra_/} [discardpath,noescape,last,qsappend]
29
RewriteRule ^.*$ %{REQUEST_SCHEME}://%2/${subdomain2path:%1}%{ENV:REQUEST_URI_no_extra_/} [discardpath,last,noescape,qsappend]
30 30

  
31 31
# use separate lowercase version when available
32 32
RewriteCond %{ENV:innermost_dir} =/
33 33
RewriteCond %{DOCUMENT_ROOT}/$1 !-d
34 34
RewriteCond .${tolower:$1} ^.*$
35 35
RewriteCond %{DOCUMENT_ROOT}/%0 -d
36
RewriteRule ^([^/]*)(.*)$ %0$2 [discardpath,noescape,last,qsappend]
36
RewriteRule ^([^/]*)(.*)$ %0$2 [discardpath,last,noescape,qsappend]
37 37
	# last: rewrite in the new subdir instead of applying this dir's rules
38 38

  
39 39
# auto-detect dotpath in query string (having a . before any = )
......
52 52

  
53 53
# don't rewrite existing dirs with trailing /
54 54
RewriteCond %{REQUEST_FILENAME} -d
55
RewriteRule ^.+/$ - [discardpath,noescape,last,qsappend]
55
RewriteRule ^.+/$ - [discardpath,last,noescape,qsappend]
56 56

  
57 57
# don't rewrite existing files
58 58
RewriteCond %{REQUEST_FILENAME} -f
59
RewriteRule ^.+$ - [discardpath,noescape,last,qsappend]
59
RewriteRule ^.+$ - [discardpath,last,noescape,qsappend]
60 60

  
61 61
# auto-add trailing / unless has an .htaccess with possible redirect
62 62
RewriteCond %{REQUEST_FILENAME} -d
63 63
RewriteCond %{REQUEST_FILENAME}/.htaccess !-f
64
RewriteRule ^.+$ %{REQUEST_URI}/ [discardpath,noescape,last,redirect,qsappend]
64
RewriteRule ^.+$ %{REQUEST_URI}/ [discardpath,last,noescape,qsappend,redirect]
65 65

  
66 66
# handle DirectoryIndex subrequests when there is no DirectoryIndex
67 67
# use -F subrequest so that MultiViews auto-appends any extension
......
72 72
# works only if dir supports relative redirects and sets %{ENV:innermost_dir}
73 73
RewriteCond %{REQUEST_FILENAME} ^(.*/)?(.+?)$
74 74
RewriteCond %1%{ENV:innermost_dir}.%2 -F
75
RewriteRule ^(?!/)(.*/)?(.+?)$ $1%{ENV:innermost_dir}.$2 [discardpath,noescape,last,redirect,qsappend]
75
RewriteRule ^(?!/)(.*/)?(.+?)$ $1%{ENV:innermost_dir}.$2 [discardpath,last,noescape,qsappend,redirect]
76 76

  
77 77
## specific to /
78 78

  
79 79
RewriteCond %{ENV:innermost_dir} =/
80
RewriteRule ^.+$ /VegCore/$0 [discardpath,noescape,last,qsappend]
80
RewriteRule ^.+$ /VegCore/$0 [discardpath,last,noescape,qsappend]

Also available in: Unified diff