Dear Wiki user,

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

The following page has been changed by Bob:
http://wiki.apache.org/httpd/Recipes/CanonicalHostNames

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

Reply via email to