Forum Moderators: open

Message Too Old, No Replies

404 pages and google

         

AbraxasEnt

8:56 pm on Jun 2, 2003 (gmt 0)

10+ Year Member



hi, i read some old topics on the subject but still find myself somewhat confused. i recently changed the names of a bunch of directories, and i figured the easiest way to redirect those who go to the old urls would be with htaccess, i want to direct them to a page with a link to my index page preferable, would google not like this for any reason? thanks

Slade

9:51 pm on Jun 2, 2003 (gmt 0)

10+ Year Member



If the pages no longer exist, you should use a 410 Gone message, then maybe include a link back to your home page in the error message.

If the pages were just shuffled around, use a 301 redirect. This will help your users and bots find their way to the new pages.

AbraxasEnt

10:02 pm on Jun 2, 2003 (gmt 0)

10+ Year Member



i just moved them, changed the name of some directories, as for the 301, do i have to do that for every page i moved? that would take a long time.

Slade

10:46 pm on Jun 2, 2003 (gmt 0)

10+ Year Member



Perhaps you can entice jpMorgan to answer this, but I believe you can. You should be able to Rewrite the olddir/ to the newdir/. Take a look at: [httpd.apache.org...] and then search for mod_rewrite on this site or google.

I'm going to take a stab at it and say your redirects should look like this:

RewriteRule  ^olddir(.*)$ newdir$1 [R=301,L]

*I didn't test that code...

Tropical Island

11:56 pm on Jun 2, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This may sound too simple however we just created a custom 404 page with our index and a short note saying that the searcher had reached a dead or incorrect link. In order to not run into duplicate problems with google we then put in a "noindex" robots text. We've been doing this for the last 8 months with no problems.

EarWig

12:00 am on Jun 3, 2003 (gmt 0)

10+ Year Member



Same here Tropical_Island

The spider should remove it on the next update.

EW

WebGuerrilla

12:03 am on Jun 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member




The problem with the custom 404 is that you lose the PR transfer. If the pages have been relocated and there were other links on the web pointing to them, a 301 will tell Google that the old links now belong to the new address.

EarWig

12:13 am on Jun 3, 2003 (gmt 0)

10+ Year Member



ARGH!
We learn something new every day :-)
Thanks for the lesson WebGuerrilla - back to the drawing board for me again.
EW

jdMorgan

12:58 am on Jun 3, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



AbraxasEnt,

As Slade says, use a 410-Gone for pages which have no logical replacement, and a 301-Moved Permanently redirect for those which have been renamed or functionally replaced.

Also, heed WebGuerilla's warning about PR transfer... You may never regret taking a shortcut to save some work, but you will never regret conforming to the protocols and doing things right.

To redirect all requests for resources in /olddir to the same-named resources in /newdir, you can use the following code.

In .htaccess, using mod_rewrite:


Options +FollowSymLinks
RewriteEngine on
RewriteRule ^olddir/(.*)$ http://www.yourdomain.com/newdir/$1 [R=301,L]

or alternately, using RedirectMatch

RedirectMatch permanent "^/olddir/(.*)$" http://www.yourdomain.com/newdir/$1

I didn't test this code either, but it should be close.

Jim