riten
riten

Reputation: 183

.htaccess redirect multiple domains

How can I redirect

sample-domain.com
sample-domain.eu
www.sample-domain.com
www.sample-domain.eu

to for example

www.sample-domain.com.pl

via 1 condition + rewriterule? For now I'm using 4 conditions with 4 (for www and non www) rewriterules witch is pretty bad I guess.

Upvotes: 1

Views: 173

Answers (1)

hjpotter92
hjpotter92

Reputation: 80653

The following rule should do:

RewriteCond %{HTTP_HOST} ^(www\.)?sample-domain\.(com|eu)$
RewriteRule ^ http://www.sample-domain.com.pl%{REQUEST_URI} [R,L]

Upvotes: 1

Related Questions