Project

General

Profile

« Previous | Next » 

Revision 8496

web/.htaccess: prepend dir name if it's part of the filename (this works only if the dir supports relative redirects and sets %{ENV:innermost_dir})

View differences:

.htaccess
63 63
RewriteCond %{REQUEST_FILENAME} !-F
64 64
RewriteRule ^(.*/)?index$ $1 [discardpath,noescape,qsappend]
65 65

  
66
# prepend dir name if it's part of the filename (e.g. dir/file -> dir/dir.file)
67
# works only if dir supports relative redirects and sets %{ENV:innermost_dir}
68
RewriteCond %{REQUEST_FILENAME} ^(.*/)?(.+?)$
69
RewriteCond %1%{ENV:innermost_dir}.%2 -f
70
RewriteRule ^(?!/)(.*/)?(.+?)$ $1%{ENV:innermost_dir}.$2 [discardpath,noescape,last,redirect,qsappend]
71

  
66 72
## specific to /
67 73

  
68 74
RewriteCond %{ENV:innermost_dir} =/

Also available in: Unified diff