Welcome Guest, Not a member yet? Register   Sign In
RewriteCond in htaccess
#1

[eluser]bapobap[/eluser]
Does anyone know where I'm going wrong?

Code:
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?!

Thanks!

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




Theme © iAndrew 2016 - Forum software by © MyBB