Revision 8475
Added by Aaron Marcuse-Kubitza almost 12 years ago
web/.htaccess | ||
---|---|---|
45 | 45 |
|
46 | 46 |
# auto-add trailing / if not external redirect (limited form of DirectorySlash) |
47 | 47 |
RewriteCond %{LA-F:REQUEST_FILENAME} -d |
48 |
RewriteRule ^/.*$() $1 [discardpath,noescape,last,redirect,qsappend]
|
|
48 |
RewriteRule ^/.*$() %{REQUEST_URI}/ [discardpath,noescape,last,redirect,qsappend]
|
|
49 | 49 |
# ^/: dir without trailing / is provided as an absolute filesystem path |
50 | 50 |
|
51 | 51 |
# don't rewrite existing paths |
Also available in: Unified diff
bugfix: web/.htaccess: auto-add trailing / if not external redirect: replace with "%{REQUEST_URI}/" instead of the empty string (which gets auto-translated to have a trailing /), because the empty string only works in the top-level dir of the .htaccess file (it redirects to the RewriteBase, which ends in /). The entire REQUEST_URI is needed to do the auto-add in dirs which do not have their own auto-add trailing / rule. Also, using REQUEST_URI avoids the need to (sometimes) set RewriteBase for use by relative URLs in replacement strings, because this is an absolute URL instead. Setting RewriteBase manually is best avoided, because it hardcodes the URL path to the .htaccess file, which may change.