| mod rewrite question for canonical issues mod_rewrite canonical |
chazeo

msg:3291049 | 4:16 pm on Mar 23, 2007 (gmt 0) | OK, so I need to generate the code to create a 301 redirect from a www version of a website to a non-www version. I found this code which works well for the opposite case (non-www to www). Can alyone help me rewrite this to make the opposite condition true? code: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST}!^www\.domain\.com$ RewriteRule ^(.*)$ [domain.com...] [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/ RewriteRule index\.html$ [domain.com...] [R=301,L] </IfModule>
|
|