Forum Moderators: bakedjake
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST}!^www\.domain\.co\.uk [NC]
RewriteRule ^(.*)$ [domain.co.uk...] [L,R=301]
</IfModule>
Is there an issue with Linux that it won't accept this mod_rewrite?
Cheers,
CaboWabo
That should work on a Linux/Apache server just fine. I tested it just now on one, and it worked. One change I would make is to test that an HTTP_HOST is being passed through, as there won't always be one:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.domain\.co\.uk [NC]
RewriteRule (.*) [domain.co.uk...] [L,R=301]
</IfModule>
Chad