Forum Moderators: open

Message Too Old, No Replies

Mulitple Domains Listed Due to Redirects

         

alexswalker

5:55 pm on Oct 31, 2003 (gmt 0)

10+ Year Member



Hi,

My main site is hosted at widgetwidget.com but I also bought widget-widget.com and widgetwidget.co.uk and a load of other similar domain names. These secondary names all are hosted on my virtual host's nameservers. These secondary names all redirect instantly to the main domain. This is done through the PLESK server control panel rather than using a meta refresh function.

Google has listed my main domain AND all my secondary names. Does this mean that my main site is penalised as the secondary names look like mirror sites?

Many Thanks
Alex

alexswalker

7:53 pm on Oct 31, 2003 (gmt 0)

10+ Year Member



Just to add the redirects to the main domain are 302 redirects.

Also I have noticed that a number of sites are have linked to the secondary domains instead of the main one. Would this be what is causing the secondary domains to be listed?

Thanks
Alex

nativenewyorker

10:42 pm on Oct 31, 2003 (gmt 0)

10+ Year Member



Perhaps you should use RedirectPermanent instead of just Redirect in your .htaccess file.

Yes, the inbound links are likely the reason for your search engine listings. Even pages marked noindex by robots.txt will show up in serps if there is inbound anchor text. The page marked noindex will not be cached and will not show a snippet.

Ted

closed

11:46 pm on Oct 31, 2003 (gmt 0)

10+ Year Member



Welcome to WebmasterWorld, alexswalker!

It looks like you guys are on the right track.

A more efficient way of tackling the problem would be to use mod_rewrite. The code you write would just have to check if the host is widgetwidget.com. If it isn't that host, then do the 301/permanent redirect.

alexswalker

11:36 am on Nov 1, 2003 (gmt 0)

10+ Year Member



Thanks for the great feedback. How exactly would I write the mod ReWrite rules to do this as I have not really used these much?

Many Thanks
Alex

closed

4:33 pm on Nov 1, 2003 (gmt 0)

10+ Year Member



Most of the work is already done. You can check this thread:

[webmasterworld.com ]

But I usually recommend reading the following two references first, to get the necessary background to understand the code:

Regular expressions [etext.lib.virginia.edu]
mod_rewrite [httpd.apache.org]

alexswalker

4:55 pm on Nov 1, 2003 (gmt 0)

10+ Year Member



Thanks for that info. I'll try it out and let you know!
Alex

alexswalker

5:09 pm on Nov 1, 2003 (gmt 0)

10+ Year Member



Just added the lines in the post you linked to but got an error 500 - :-(

This is what is what was in my .htaccess file before I did anything and these lines must stay:

RewriteEngine on
RewriteRule ^.*L([0-9]+)/?$ /printing-embroidery/Detailed/$1.html [L,T=application/x-http-cgi]
RewriteRule ^$ /cgi-bin/page.cgi?d=1&page=homepage [L,T=application/x-http-cgi]

The first one gives my product catalogue a search engine friendly layout and the second one points my main domain to a dynamic homepage.

There there some kind of conflict occuring? I am happy to sticky my domain to anyone who is interested.

Thanks
Alex

closed

5:40 pm on Nov 1, 2003 (gmt 0)

10+ Year Member



If you have access to your domain's error logs, now would be a good time to check it.

Did you read Jim's note (last post in the thread) about putting a space between {HTTP_HOST} and the exclamation point?

alexswalker

6:17 pm on Nov 1, 2003 (gmt 0)

10+ Year Member



Ahh - that fixed it. Should have read on!

Okay there are no error 500 pages now.

Howvever when I used sam spade to check to check a domain that was being redierct via the 'webforwarding' control panel of my doamin registrar I got:

HTTP/1.1 302 Moved
Content-type: text/html

Is this right? - I thought the rewrite rule was meant to cause a 301 to show or am I mistaken?

Many thanks for all your help so far - this is a superb forum!

closed

6:27 pm on Nov 1, 2003 (gmt 0)

10+ Year Member



By default, redirects with RewriteRule have a 302 status code. You'll have to explicitly mention in each rule that you want to send a 301, if that's your intention.

In your previous .htaccess file, the R flag wasn't used to set the status code, so the redirects returned a 302. Also keep in mind that the order in which you put the rules matters in this case.