Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- Again som rewrite/redirect


lucy24 - 1:17 pm on Oct 13, 2012 (gmt 0)


Urk! Where did
\.co.\.uk
come from? In the pattern it should be simply \.co\.uk
And in the target .co.uk unless your cat stepped on the keyboard.

Now at least rewrite happens, but evrything goes to .com instead of leaving .co.uk as it is.

So it really is one domain name and a gazillion different tld's? I thought you were just making that up to fit into the example.something pattern.

.co.uk is getting picked up along with everything else because you haven't told the RewriteRule not to pick it up. Once its name is in exactly the right form it will bypass the .co.uk redirect rule and hit the universal rule instead. Your final rule therefore needs one more condition:

RewriteCond %{HTTP_HOST} !www\.example\.(com|co\.uk|nl)$

listing all the Good versions of example. This will filter out the ones that are already correct, leaving only the ones that need redirecting. That applies equally to

example.com:8080
and
www.example.su

Same redirect for both.


Thread source:: http://www.webmasterworld.com/apache/4506967.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com