Forum Moderators: phranque

Message Too Old, No Replies

301 redirect only working for index.html page?

Want to redirect entire site from old domain to new domain

         

dmsvoltaire

12:56 am on Jul 4, 2005 (gmt 0)



Hi:

After four years of having my site under a domain that I didn't really like, but which was the closest I could get to what I really wanted, I have finally been able to obtain the domain name I wanted all along. Having had the site for nearly four years, it has close to 10,000 individual pages.

I've been unhappy with the hosting company hosting my old domain, so I registered the new domain with a new hosting company, set everything up, and put up a duplicate of the entire site under the new domain. I've worked very hard to obtain good search rankings under the old domain name, so I want to do everything I can to preserve that work. I plan to keep the old site (which is already prepaid for a year anyway) in place until I'm sure the new site has assumed its same #1 ranking in the search engines.

I've already contacted all my link partners and asked them to change the link, and I've made all the changes I could in places where links are submitted by users.

I can't create and upload an .htaccess file with my old hosting company, I can only use Cpanel to create a redirect that is then placed in an already-existing .htaccess file.

That's fine, I accessed the redirect page and said I wanted to permanently (301) redirect the entire site from the old domain to the new one

The line looks like this:

Redirect 301 / [newdomain.com...]

Now, when I enter the old domain name or click on its listings in a search engine, the redirect works for the main index.html page, but if I enter in the name of any subsidiary page, or if I click on an existing link, I still return to the old site.

My question (after all that lengthy explanation, but I wanted to get all the info there) is, why doesn't the 301 redirect send every access to the old site to the new one?

I thought a redirect written like the one I have above would redirect every query for an old page to the corresponding new page. All the files exist on the new site, with the same names, except that the domain name has changed. I really don't want to have to add a redirect for every single page on the old site, that would take me weeks to set up. And even so, I did try to add a redirect for one deeper page, and it didn't work! After I had added that line to the redirect page, when I clicked on that page in a search engine listing, it redirected to the main index.html page and not the deeper page with the full name I'd clicked on.

I just don't get it. I've tried and tired to figure out what I'm doing wrong or how I could do it differently.

I don't understand how to write Apache code and I'm nervous about trying to do so. I've read about mod_rewrite files, but they make me too nervous. I've also read that using the 301 redirect is the safest way not to damage my search engine rankings, so I really want to make this work.

Any hints, tips, suggestions, or other info that anyone can think of which might help? Anything at all would be *most* appreciated!

Thanks!

dms