To be specific:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
    RewriteRule ^(.*)$ http://example.co.uk$1 [R=301,L]

    I've typed that enough times I don't really have to think about it
    anymore ;)


Thanks Tony & Johnathon.

I had tried mod_rewrite but clearly got my rules messed up previously.

Just to correct what Johnathon wrote, I think the last line should be:
     RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
Really appreciated; that's been on my list of jobs for a while!


No, I really did mean "uk$1" ;)

The / is added by almost every web-browser, if you have /$1, redirected visitors will see http://example.co.uk// :-)

Johnathon


--
All postal correspondence to:
The Positive Internet Company, 24 Ganton Street, London. W1F 7QY

*Follow us on Twitter* @posipeople

The Positive Internet Company Limited is registered in England and Wales.
Registered company number: 3673639. VAT no: 726 7072 28.
Registered office: Northside House, Mount Pleasant, Barnet, Herts, EN4 9EE.

_______________________________________________
Peterboro mailing list
[email protected]
https://mailman.lug.org.uk/mailman/listinfo/peterboro

Reply via email to