httpd-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Httpd Wiki] Trivial Update of "CanonicalHostNames" by TBille
Date Wed, 31 Oct 2012 16:52:48 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Httpd Wiki" for change notification.

The "CanonicalHostNames" page has been changed by TBille:
http://wiki.apache.org/httpd/CanonicalHostNames?action=diff&rev1=12&rev2=13

Comment:
Fix leading slash problem, which i encountered using the example on debian lenny / 2.2

  RewriteCond %{HTTP_HOST}   !^example\.com [NC]
  RewriteCond %{HTTP_HOST}   !=""
  RewriteCond %{SERVER_PORT} !=80
- RewriteRule ^/(.*)         http://example.com:%{SERVER_PORT}/$1 [L,R=301]
+ RewriteRule ^/?(.*)         http://example.com:%{SERVER_PORT}/$1 [L,R=301]
  
  # And for a site running on port 80
  RewriteCond %{HTTP_HOST}   !^example\.com [NC]
  RewriteCond %{HTTP_HOST}   !=""
- RewriteRule ^/(.*)         http://example.com/$1 [L,R=301]
+ RewriteRule ^/?(.*)         http://example.com/$1 [L,R=301]
  }}}
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Mime
View raw message