Project

General

Profile

« Previous | Next » 

Revision 9600

web/.htaccess: <dir>/all forces mod_dir listing: use simpler $mod_dir_listing env var instead of query string modification to indicate that an explicit mod_dir listing should be displayed. this causes /all to replace ?index=1 as the way to force a mod_dir listing. note that the %{ENV:...} test needs to use $REDIRECT_mod_dir_listing instead of $mod_dir_listing, because a redirect will occur between the /all rule and the index.* rule, causing all env vars to be prepended with REDIRECT_ .

View differences:

web/.htaccess
65 65
RewriteRule ^.+$ %{REQUEST_URI}/ [discardpath,last,noescape,qsappend,redirect]
66 66

  
67 67
# <dir>/all forces mod_dir listing
68
RewriteRule ^(.*/)?all$ $1?index=1 [discardpath,last,noescape,qsappend]
68
RewriteRule ^(.*/)?all$ $1 [discardpath,last,noescape,qsappend,env=mod_dir_listing:1]
69 69

  
70
# for dirs, redirect to index.* unless mod_dir listing requested with ?index=1
70
# for dirs, redirect to index.* unless mod_dir listing requested previously
71 71
RewriteCond %{REQUEST_FILENAME}index -F
72 72
	# use -F subrequest so that MultiViews auto-appends any extension
73
RewriteCond %{QUERY_STRING} !(?:^|&)index=[^&]
73
RewriteCond %{ENV:REDIRECT_mod_dir_listing} =""
74 74
RewriteRule ^(.*/)?$ $1index [discardpath,last,noescape,qsappend]
75 75

  
76 76
# prepend dir name if it's part of the filename (e.g. dir/file -> dir/dir.file)

Also available in: Unified diff