Raz Raz - 5 months ago 26
HTML Question

Redirect website to addon domain - htaccess

I have a hosting that has a master domain and also 5 more (Addon) domains under this same host.
All the websites run Wordpress on them.
I would like to redirect the master domain to one of the addon domains and i have a problem with parts of the redirects, all the pages are redirecting to the right places but some resources seem to enter a infinite redirection loop (wp-include css for example).
the redirection iv'e tried:

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^crossword\-clue\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^crossword\-clues\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.wisely\-chosen\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^wisely\-chosen\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.info\-beast\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^info\-beast\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.crossword\-clues\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.quickinfo\.co\.il$ [NC,OR]
RewriteCond %{HTTP_HOST} !^www\.israwords\.co\.il$ [NC,OR]
RewriteCond %{HTTP_HOST} !^israwords\.co\.il$ [NC,OR]
RewriteCond %{HTTP_HOST} ^israwords\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www\.israwords\.com$ [NC]
RewriteRule ^(.*)$ http://www.israwords.co.il/$1 [R=301,L]

Answer

To redirect

  • www.israwords.com

to

  • www.israwords.co.il

You can use this :

RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www\.)?israwords\.com$
RewriteRule ^ http://www.israwords.co.il%{REQUEST_URI} [L,R=301,NE]