Forum Moderators: phranque

Message Too Old, No Replies

many sites using same htaccess file

many sites using same htaccess file

         

rednokes

9:54 pm on Sep 20, 2007 (gmt 0)

10+ Year Member



Hi

We have several websites which all point the same pages

www.domain1.com/about/page.aspx is the same info as www.domain2.com/about/page.aspx and www.domain3.com/about/page.aspx

they all use the same htaccess file

i would like to add a query string to just one of the sites ie

www.domain1.com/about/page.aspx to redirect to www.domain1.com/about/page.aspx?newitem=b01

is his possible?

some help please!

jdMorgan

10:40 pm on Sep 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, it's possible using a mod_rewrite RewriteCond testing %{HTTP_HOST} for the 'correct' domain to make the redirect conditional. But it sounds like your application calls for an internal rewrite, not a redirect, and that's what I'd advise.

However, the description of your site(s) sounds like a recipe for search-ranking disaster -- You have created a duplicate-content problem, and the result will be that the search engines will see those identical pages, 'pick one' of them based on their own priorities (not yours), and drop the others.

Best practice would be to redirect all secondary domains to one single domain, and promote only that one domain. Doing this, you make the one domain more powerful that the sum of the others, cut promotion costs, concentrate back-links, link-popularity, and PageRank, etc.

Jim

rednokes

8:48 am on Sep 21, 2007 (gmt 0)

10+ Year Member



thanks so much for your help - got it working

thanks for the advice too!

rednokes

8:52 am on Sep 21, 2007 (gmt 0)

10+ Year Member



oh sorry one last question - seeing as i need to add the same query strings to all the site pages is there a way to add the query string to any url form that domain

i currently have:

RewriteCond %{HTTP_HOST}!^www\.domain\.co\.uk [NC]
RewriteRule /AboutUs/OurAim\.aspx /AboutUs/OurAim.aspx?newitem=b01 [I,L,RP]

Dont want to have to do each page ie.

RewriteCond %{HTTP_HOST}!^www\.domain\.co\.uk [NC]
RewriteRule /AboutUs/OurAim\.aspx /AboutUs/OurAim.aspx?newitem=b01 [I,L,RP]

RewriteCond %{HTTP_HOST}!^www\.domain\.co\.uk [NC]
RewriteRule /AboutUs/history\.aspx /AboutUs/history.aspx?newitem=b01 [I,L,RP]

rednokes

9:14 am on Sep 21, 2007 (gmt 0)

10+ Year Member



i've just noticed it's adding that querystring to all domains ;-(

jdMorgan

12:13 pm on Sep 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You appear to be using the syntax for ISAPI Rewrite on Microsoft IIS Server. Can we confirm whether you're on IIS or Apache?

Jim

rednokes

1:41 pm on Sep 21, 2007 (gmt 0)

10+ Year Member



I've been told it's Apache

i thought the syntax was identical

thank u

rednokes

2:14 pm on Sep 21, 2007 (gmt 0)

10+ Year Member



chnaged it to:

RewriteCond Host: www\.domain1\.co\.uk
RewriteRule /AboutUs/OurAim\.aspx* /AboutUs/OurAim.aspx?newitem=b01 [I,L,RP]

working fine now

thank you!