Welcome to WebmasterWorld Guest from 54.158.21.160

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Need to consolidate all incoming links

subdomains and subdirectories to home page

     
3:07 pm on Apr 22, 2004 (gmt 0)

New User

10+ Year Member

joined:Aug 28, 2003
posts:14
votes: 0


Is there a script available that I can use to consolidate and forward all links coming to a site to another site's homepage?

I have lots and lots of links coming in to a domain and they are scattered everywhere throughout the site. I would like for all of these links coming in to lead to just one page, preferable to the home page of a new website. Maybe some sort of a 301 permanent redirect where I wouldn't be penalized? .htaccess?

I looked around for several hours and did not see anything that I thought would work. So if anyone can help me it sure would be appreciated.

The script

RewriteEngine On
RewriteRule .* [newdomain.com...] [R=301,L]

seems to work well on all subdirectories and subfiles but it does not redirect the subdomains and their files as well. Is there a script that will take care of all subdirectories and subdomains?

Thanks so much. Any help I get would be deeply appreciated. Have a great day!

Scott

3:19 pm on Apr 27, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 31, 2002
posts:25430
votes: 0


> I would like for all of these links coming in to lead to just one page, preferable to the home page of a new website. Maybe some sort of a 301 permanent redirect where I wouldn't be penalized? .htaccess?

There is the danger that the old pages will now be seen as doorway pages for the new site, so I don't recommend this. There are two safer/better approaches:

  • Redirect each page on the old site to an equivalent page on the new site, or to a site map on the new site if there is no 'close' replacement page.

  • Let the old pages return a 404-Not Found (HTTP/1.0) or 410-Gone (HTTP/1.1 and above) status, and provide a site map as the custom error page.

    These are safer because they eliminate or reduce the number of 'doorway pages' and because they give a better user-experience.

    Your rewrite code, as posted, should redirect all requests to the new site. However, in order for it to work, it will have to be in the path from the server root to any subdirectories or subdomains you wish to redirect. So, the problem you're having is probalby that the code is not being executed for subdomain requests. You'll need to investigate how your subdomains are implemented on your server. In other words, for a subdomain request URL, where are the files located in your account's file space? -- How are these URLs 'mapped' into your server's filesystem.. Where are they? You can start with your DNS 'A' records, and trace forward from there.

    You may have to put a copy of the code in each subdomain's 'root' folder in order for it to work.

    Jim

  • 7:37 pm on Apr 27, 2004 (gmt 0)

    New User

    10+ Year Member

    joined:Aug 28, 2003
    posts:14
    votes: 0


    >You may have to put a copy of the code in each subdomain's 'root' folder in order for it to work.

    Hi Jim,

    Thanks for taking the time to read and reply. I appreciate it!

    One of the domains in particular that I am referring to - gave out free subdomains. There are over 9,900 subdomains that I am aware of. And a lot of these subdomains have subpages in them - they are baby web sites. I bought the domain as is and it was transferred to me as a domain only. Recreating and then redirecting each subdomain's root folder individually would take a tremendous amount of work.

    I know there is traffic here but I am not utilizing it. That is why I wanted to redirect all traffic (subdomains included) to a centralized location. That centralized location could be the index page of the web site I am writing about or a different web sites' home page. I don't really care. However, in the future if something like this comes up again it would be nice to know how to do either.

    I am not keen on using the 404 or 410 pages as a way of utilizing the traffic as I think not many people will click again.

    I was thinking that if I used the 301 permanent redirect then maybe I might not be penalized as having doorway pages. If I do get penalized, then so be it. That is the chance I am willing to take.

    So, if you know how to redirect all traffic including subdomains to a centralized location via a 301 redirect - that sure would be nice to know.

    Thanks again Jim.

    Peace,
    Scott

    7:50 pm on Apr 27, 2004 (gmt 0)

    Senior Member

    WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

    joined:Mar 31, 2002
    posts:25430
    votes: 0


    > You may have to put a copy of the code in each subdomain's 'root' folder

    It should work. Find out why it doesn't work, as suggested above. If you have access to httpd.conf, put the code there.

    Jim