Project

General

Profile

« Previous | Next » 

Revision 9597

web/.htaccess: handle DirectoryIndex redirects in a RewriteRule instead of with `DirectoryIndex index`, so that RewriteConds can be used to configure when index.* is used as the DirectoryIndex instead of a mod_dir listing

View differences:

.htaccess
3 3
Options +FollowSymLinks +Indexes +MultiViews
4 4

  
5 5
DirectorySlash off
6
DirectoryIndex index
6
DirectoryIndex on
7
	# index.* also supported (by "redirect to index.*" RewriteRule)
7 8

  
8 9
### mod_rewrite
9 10

  
......
63 64
RewriteCond %{REQUEST_FILENAME}/.htaccess !-f
64 65
RewriteRule ^.+$ %{REQUEST_URI}/ [discardpath,last,noescape,qsappend,redirect]
65 66

  
66
# handle DirectoryIndex subrequests when there is no DirectoryIndex
67
RewriteCond %{REQUEST_FILENAME} !-F
67
# for dirs, redirect to index.*
68
RewriteCond %{REQUEST_FILENAME}index -F
68 69
	# use -F subrequest so that MultiViews auto-appends any extension
69
RewriteRule ^(.*/)?index$ $1 [discardpath,noescape,qsappend]
70
RewriteRule ^(.*/)?$ $1index [discardpath,last,noescape,qsappend]
70 71

  
71 72
# prepend dir name if it's part of the filename (e.g. dir/file -> dir/dir.file)
72 73
# works only if dir supports relative redirects and sets %{ENV:innermost_dir}

Also available in: Unified diff