Project

General

Profile

« Previous | Next » 

Revision 10611

bugfix: web/.htaccess: parse dotpath in query string: redirect so REQUEST_URI is populated from REQUEST_FILENAME: need to use - instead of $0 as the redirect destination so that REQUEST_FILENAME is used instead of the empty REQUEST_URI (i.e. the redirect vars are left untouched)

View differences:

web/.htaccess
44 44
RewriteRule ^ ?.%{QUERY_STRING} [discardpath,noescape]
45 45

  
46 46
## parse dotpath in query string
47
# add trailing / if dotpath so that dest path is URL path, not filesystem path
48
RewriteCond %{QUERY_STRING} ^\.
49
RewriteRule ^/ %{REQUEST_URI}/ [discardpath,last,noescape,qsappend,redirect]
50 47
# parse dotpath levels repeatedly in QUERY_STRING
51 48
RewriteCond %{QUERY_STRING} ^\.([^./&]*?)(?:\[([^\[\]/&]*)\])?([.&].*)?$
52 49
RewriteRule ^(.*?)(?:/(?:index(?:\.\w+)?)?)?$ $1/%1%2?%3 [discardpath,noescape,next,env=needs_redirect:1]
53 50
# redirect so REQUEST_URI is populated from REQUEST_FILENAME
54 51
RewriteCond %{ENV:needs_redirect} !=""
55
RewriteRule ^.*$ $0 [discardpath,last,noescape,qsappend,redirect]
52
RewriteRule ^ - [discardpath,last,noescape,qsappend,redirect]
53
	# - uses REQUEST_FILENAME as redirect dest instead of empty REQUEST_URI
56 54

  
57 55
# <dir>/all forces mod_autoindex listing
58 56
RewriteRule ^(.*/)?all$ $1 [discardpath,last,noescape,qsappend,env=mod_autoindex_listing:1]

Also available in: Unified diff