redirect domains to a principal

Topics: User Forum
Dec 3, 2009 at 11:53 AM

Hi all,
i got 5 domain like "www.keyword.info", "www.keyword.it", "www.keyword2-keyword.com", etc...

I need a rex epr (I try but seem no run correctly) to redirect all url to one principal like "www.myprefered.it"

The incoming url is like:
http://www.keyword1-keyword2.info/aminoacidi-pastiglie-barattolo-power-acetyl-l-carnitina-acetil-l-carnitina-280-90-cps~P4109

a need a rule for redirection on
http://www.myprefered.it/aminoacidi-pastiglie-barattolo-power-acetyl-l-carnitina-acetil-l-carnitina-280-90-cps~P4109

 

I write this one on my .ini files:

RewriteCond %{HTTP_HOST}    ^(.*)\.keyword1-keyword2\.info   [OR]
RewriteCond %{HTTP_HOST}    ^(.*)\.keyword1\.com                  [I]
RewriteRule ^(.*)$         http:/www.webnutrition.it/$1                    [L,R=301]

Wrong someting?

Thanks Alen Italy

Coordinator
Dec 3, 2009 at 8:24 PM

Buon giorno Signor Cappalletti,

You cannot use the [R=301] modifier  with the RewriteRule.  You must use it with RedirectRule.  

If you look into the IIRF log file, you will see a warning related to this.  Also with Redirects, you do not need [L].  The redirect is implicitly the last action. 

Also, attach [I] to the initial RewriteCond, like so:  [I,OR]

If you change that, your rules will look like this:

RewriteCond %{HTTP_HOST}    ^(.*)\.keyword1-keyword2\.info     [I,OR]
RewriteCond %{HTTP_HOST}    ^(.*)\.keyword1\.com               [I]
RedirectRule ^(.*)$         http:/www.webnutrition.it/$1       [R=301]

With those modifications, I think your rule may work.

Dec 4, 2009 at 8:43 AM

Thak you Cheeso run it!