Project

General

Profile

« Previous | Next » 

Revision 8012

web/main/.htaccess: RewriteRules with [redirect]: Added last because apparently redirect will not immediately cause the redirect, and will instead continue rewriting the URL ("You will almost always want to use [R] in conjunction with [L] (that is, use [R,L]) because on its own, the [R] flag prepends http://thishost[:thisport] to the URI, but then passes this on to the next rule in the ruleset, which can often result in 'Invalid URI in request' warnings." <http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_r&gt;)

View differences:

web/main/.htaccess
10 10

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

  
15 15
# translate subdomain to path
16 16
RewriteCond expr "%{HTTP_HOST} != %{SERVER_NAME}"

Also available in: Unified diff