Ad

.htaccess - Redirect Domain.pl/something To Domain.eu/something-else

- 1 answer

I want to make redirect from old links to new, for example:

domain.pl/cat -> domain.eu/dog

The problem is, that I don't want to redirect domain.eu/cat to domain.eu/dog - how to write correct htaccess rule for that?

Ad

Answer

RewriteCond %{HTTP_HOST} ^(www\.)?olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com$1 [R=301,QSA,L]
Ad
source: stackoverflow.com
Ad