Project

General

Profile

« Previous | Next » 

Revision 9612

bugfix: web/.htaccess: need to do DirectoryIndex redirects before checking for existing file/dir, because a DirectoryIndexed dir is existing but still needs to be redirected to the index.* file

View differences:

web/.htaccess
51 51
RewriteCond %{ENV:needs_redirect} !=""
52 52
RewriteRule ^.*$ $0 [discardpath,last,noescape,qsappend,redirect]
53 53

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

  
57
# for dirs, redirect to index.* unless mod_autoindex listing was requested
58
RewriteCond %{REQUEST_FILENAME}index -F
59
	# use -F subrequest so that MultiViews auto-appends any extension
60
RewriteCond %{ENV:REDIRECT_mod_autoindex_listing} =""
61
RewriteRule ^(.*/)?$ $1index [discardpath,last,noescape,qsappend]
62

  
54 63
# don't rewrite existing dirs with trailing /
55 64
RewriteCond %{REQUEST_FILENAME} -d
56 65
RewriteRule ^.+/$ - [discardpath,last,noescape,qsappend]
......
64 73
RewriteCond %{REQUEST_FILENAME}/.htaccess !-f
65 74
RewriteRule ^.+$ %{REQUEST_URI}/ [discardpath,last,noescape,qsappend,redirect]
66 75

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

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

  
76 76
# prepend dir name if it's part of the filename (e.g. dir/file -> dir/dir.file)
77 77
# works only if dir supports relative redirects and sets %{ENV:innermost_dir}
78 78
RewriteCond %{REQUEST_FILENAME} ^(.*/)?(.+?)$

Also available in: Unified diff