• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RewriteCond in htaccess

Does anyone know where I'm going wrong?

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} ^domain.net$ [OR]
RewriteCond %{HTTP_HOST} ^domain.co.uk$

RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^www\. domain\.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

I basically want everything to redirect to http://domain.com/$ with $ being whatever the request is. So if someone types in domain.net, they get 301'd to domain.com. Or if they request domain.net/lovely/page/ they get 301'd to domain.com/lovely/page.

The above code seems to work for the homepage but not anything else.

Any ideas?!


Edit: Removed all but the last [L], same result.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.