0
votes

I've decided to change my domain to a more brandable. It's a travel website with tips on things to do in different cities around the globe.

Right now each page starts with "city" in the url. Examples:

www.olddomain.com/city-new-york

www.olddomain.com/city-london

www.olddomain.com/city-paris

On the new domain each page will start with "tips" instead. Examples:

www.newdomain.com/tips-new-york

www.newdomain.com/tips-london

www.newdomain.com/tips-paris

What can i write in the htaccess-file to make a 301 redirect from www.olddomain.com/city-xxx to www.newdomain.com/tips-xxx? Is this even possible or do I have to do it manually for each domain?

1

1 Answers

0
votes

You can use a redirect match:

RedirectMatch 301 ^/city-(.*)$ http://www.newdomain.com/tips-$1

Any query strings will automatically get appended to the end.