Project

General

Profile

« Previous | Next » 

Revision 8387

web/.htaccess: Use %{REQUEST_URI} ("The path component of the requested URI" <http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritecond&gt;) instead of /$0, in order to preserve whether or not the path had a trailing slash. This also ensures that the rule functions correctly if it is invoked in a subdir context, which may occur for the "remove www subdomain" rule.

View differences:

.htaccess
12 12

  
13 13
# remove www subdomain
14 14
RewriteCond %{HTTP_HOST} ^www\.(.*)$
15
RewriteRule ^.*$ http://%1/$0 [discardpath,noescape,last]
15
RewriteRule ^.*$ http://%1%{REQUEST_URI} [discardpath,noescape,last]
16 16

  
17 17
# remove linewraps used to create a newline for Google spreadsheets
18 18
RewriteRule ^_-(.*)$ /$1 [discardpath,noescape,last,redirect]
......
20 20
# translate subdomain to path
21 21
RewriteCond %{HTTP_HOST} !=vegbiendev.nceas.ucsb.edu
22 22
RewriteCond %{HTTP_HOST} ^(.*)\.([^.]*\.[^.]*)$
23
RewriteRule ^.*$ http://%2/${subdomain2path:%1}/$0 [discardpath,noescape,last]
23
RewriteRule ^.*$ http://%2/${subdomain2path:%1}%{REQUEST_URI} [discardpath,noescape,last]
24 24

  
25 25
# use separate lowercase version when available
26 26
RewriteCond %{DOCUMENT_ROOT}/$1 !-d

Also available in: Unified diff