Welcome to WebmasterWorld Guest from 54.144.107.83

Message Too Old, No Replies

301 or 404? Don't they do the same thing

     
6:26 pm on Sep 15, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 23, 2004
posts:78
votes: 0


I just removed thousands of duplicate content pages.
I maintain a list of these pages in an .htaccess file, and have given them all a 301 redirect to my homepage.

I was considering putting a 404 on all of them instead, which would send the user to a custom 404 page.

However, I have been reading that the 301 tells Google that the page doesn't exist, remove the link from the index and permanently redirect the user.

Wouldn't a 404 tell Google the same thing? That the page doesn't exist anymore? The user would hit a custom page that lets them know this.

Which one is best for SEO purposes? The 404 seems more user friendly, while the 301 seems more SE friendly.

6:50 pm on Sept 15, 2006 (gmt 0)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


They are two different creatures. 404 says the URL was not found. 301 says the content on that URL has moved permanently to new URL. Both have their uses, depending on the situation.
2:50 am on Sept 16, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 23, 2004
posts:78
votes: 0


Sounds like it wouldn't be a good idea to then do a couple hundred 301's to our home page in an htaccess file...

Do i reference all my pages that are 404 in an htaccess file with "ErrorDocument 404"?

If so, would a 404 reference in an htaccess file take precendent over the fact that the files still exist in the directory? (they are just not beeing linked to anywhere and therefore not used.

Thanks

7:30 pm on Sept 16, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


>> If so, would a 404 reference in an htaccess file take precendent over the fact that the files still exist in the directory? <<

There is a misunderstanding here.

If the file still exists then it will be served with a "200 OK" reponse and the content indexed (unless you put a meta robots noindex tag on the page).

If there is a 301 redirect for that URL declared in the .htaccess file then that file can not in fact be accessed. The redirect is served first, and the browser then requests the new URL that it was told to ask for.

The server can only give a 404 response if the requested file is NOT found on the server.

The ErrorDocument directive tells the server to show the content of the named file, instead of the standard "Error 404 - Page not Found" message that is built in to the system.

The format is:

ErrorDocument 404 /my.error.message.page.html