I have in htaccess some like this:
RewriteCond %{HTTP_HOST} !^foo
RewriteCond %{HTTP_HOST} !^bar
RewriteCond %{HTTP_HOST} !^some
RewriteRule ^register,(.*)$ /register.html [R=301,L]
RewriteRule ^offer,(.*)$ /offer.html [R=301,L]
It redirect me if I write http://foo.domain.com/register,one.html I want it only on http://domain.com/register,one.html or http://www.domain.com/register,one.html
What is wrong?
In the example that you've given, you will most certainly not be redirected.
However, it looks like you're expecting the
RewriteCond
directives to apply to both of theRewriteRule
directives - they do not. They only apply to theRewriteRule
that immediately follows them.So, in your example,
http://foo.domain.com/register,one.html
will not redirect you - buthttp://foo.domain.com/offer,one.html
will.What you probably need is something more along these lines: