rewrite 301 all pages, multidomain name

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 2
Joined: 10 Jul 2014, 06:33

rewrite 301 all pages, multidomain name

10 Jul 2014, 06:41

i have four domain:
sky-mond.com
skymond.com
sky-mond.vn
vanghungphu.com

All domain point to a website.
and sky-mond.com is primary domain, we want to seo it
But vanghungphu.com was create first and have many pages indexed
I want to redirect 301 all link from other to sky-mond.com/link
Please help me config httpd.conf
Thanks

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: rewrite 301 all pages, multidomain name

10 Jul 2014, 09:04

Hello,

The rules should be:

RewriteBase /
RewriteCond %{HTTP_HOST} ^(?:skymond\.com|sky-mond\.vn|vanghungphu\.com)$ [NC]
RewriteRule (.*) http://sky-mond.com/$1 [NC,R=301,L]

User avatar
Posts: 2
Joined: 10 Jul 2014, 06:33

Re: rewrite 301 all pages, multidomain name

11 Jul 2014, 04:31

thanks, but seem to be not work
This is rewrite log:
C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
183.80.195.173 183.80.195.173 Fri, 11-Jul-2014 14:29:32 GMT [www.camdogiare.vn/sid#22380][rid#20066880/initial] (3) applying pattern '(.*)' to uri 'Default.aspx'
183.80.195.173 183.80.195.173 Fri, 11-Jul-2014 14:29:32 GMT [www.camdogiare.vn/sid#22380][rid#20066880/initial] (4) RewriteCond: input='www.camdogiare.vn' pattern='^(?:skymond\.com|sky-mond\.vn|vanghungphu\.com)$' => not-matched

i have a VPS with some website

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: rewrite 301 all pages, multidomain name

11 Jul 2014, 05:10

Hello,

The log shows the request to www.camdogiare.vn which you haven't mentioned before. Is it another domain that should be redirected?
Also, please make a small fix to the rules:

RewriteBase /
RewriteCond %{HTTP_HOST} (?:skymond\.com|sky-mond\.vn|vanghungphu\.com) [NC]
RewriteRule (.*) http://sky-mond.com/$1 [NC,R=301,L]

User avatar
Posts: 92
Joined: 01 Dec 2012, 14:22

Re: rewrite 301 all pages, multidomain name

23 Jul 2014, 12:45

Anton- would it not be more efficient to test that the HTTP_HOST is *not* the desired canonical domain, and redirect if so?
Would also catch anything forgotten.

User avatar
Posts: 871
Joined: 12 Mar 2012, 09:54

Re: rewrite 301 all pages, multidomain name

24 Jul 2014, 07:58

Hello,

"Anton- would it not be more efficient to test that the HTTP_HOST is *not* the desired canonical domain, and redirect if so?"
- It's a possibility. The rule should be like:

RewriteBase /
RewriteCond %{HTTP_HOST} !^sky-mond\.com$ [NC]
RewriteRule (.*) http://sky-mond.com/$1 [NC,R=301,L]

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 0 guests