Forum Moderators: phranque

Message Too Old, No Replies

404 errors.Can u guys please teach me how to redirect a "404URL"?

404s which I can't track.Planning to redirect it.Is it suitable?

         

Lowkei

11:59 am on Aug 6, 2005 (gmt 0)

10+ Year Member



Hi all,
My site appears 404s error which I can't track where is my mistake.Therefore,I'm planning to redirect the "404 URL"(which doesn't exist) that is requested to other page.Is that suitable?

And,how to redirect a URL?Or anyone knows about any sources that I can refer to?I tried placing the code below in a blank .htaccess file and it doesn't work.(I thought it's a redirect command.Am I actually correct?Or I have missed something?)

Redirect permanent /home/NAME=none http://www.example.com/home/

Please help.I did check my site with W3C link checker but it returned no error..I'm kind of blur.. :)
Thanz in advance..

Regards,
Lowkei

jbinbpt

1:13 pm on Aug 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try this instead

ErrorDocument 404 [yoursite.com...]

Are all your pages returning 404's? Run the site through a spider simulator such as this...

[searchengineworld.com...]

A comman reason for 404's are mismatched case in file names and extensions.

encyclo

1:26 pm on Aug 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In fact, you should never specify the full URL for the ErrorDocument, otherwise it becomes a 302 redirect instead of a 404 error. Try this:

ErrorDocument 404 /404.html

Lowkei

3:39 pm on Aug 6, 2005 (gmt 0)

10+ Year Member



Thanks for the reply :)
No,not all my pages return 404.In fact,there is only one weird 404 I'm talking about here.It returns 404...where ppl requesting a URL which doesn't exist..but the URL is quite similiar to one of my page's URL..

My page = www.example.com/home/NAME.htm
The request = www.example.com/home/N%20A%20M%20E.htm

(I was known that the %20 is a space..Am I correct?)

I have tried check manually all the HTML (it's not a big site-20++pages) but still I cant see any incorrect link URL as that.

Then I planned to redirect jz that particular URL to other page.Unfortunately,I don't know about that.Any further advice?(Jbinbpt,is the code you gave are redirect code?Means that's the way how to redirect?)

Oh ya,encyclo,bout the code you gave..

ErrorDocument 404 /404.html

Is it that I just type in "ErrorDocument 404" will do?Or need to add in other extra commend?
Thanks in advance.

Regards,
Lowkei

encyclo

12:37 am on Aug 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For the .htaccess ErrorDocument command, you first specify the type of error you are defining (in this case the 404), then you give the local URL (not the full URL) of the error page:

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

For your particular problem, I would use the W3C link checker to go through your site to check for broken links:

[validator.w3.org...]

As you have guessed, the problem is a link with spaces in the URL, but it may not be a link on your own site but someone else's. Then you need to set up a 301 permanent redirect from the non-existant page to the correct one. I'm not sure of the best method, so I'll let the experts here give you some guidance. :)

JAB Creations

2:38 am on Aug 7, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Setting up a 404 page is one thing...getting your visitors tot he page (and possibly the product you're selling is another).

Redirect permanent /bad404notherefile.html http://www.example.com/yourredirect.html

If you're tracking 404s or changing file names help your visitors stay on track... because if they fall off they may not jump back on.

Lowkei

7:00 am on Aug 7, 2005 (gmt 0)

10+ Year Member



I actually got a 404.shtml file..And it's functioning properly so far..When there's a 404,it will lead the visitors to that file..
When the weird URL is being reqeusted,the 404.shtml is still functioning..But I just want to make it as perfect as possible :) hoping that's not any 404 in my site...hehe.Thus I'm thinking whether redirect ONLY that particular weird URL to a certain page will work..
Regargding the code..
Redirect permanent /bad404notherefile.html http://www.example.com/yourredirect.html

What's actually the function of this code?What should I expect after saving it in the .htaccess?I tried save it and I can't notice any changes.
Thanks ..

Regards,
Lowkei

JAB Creations

11:37 am on Aug 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Let me give you a scenerio so you have a working example of why a 301 (permanent redirect) is useful.

Imagine you'll selling widgets online. If for any given reason you rename a file or move a product potential customers who will be exposed to now incorrect search engine results (typically up to several months) will not find the product that they had an interst in via the search engine.

Putting up a 404 page should only effectively make you aware of retard bots and retards in general.

If you've got normal visitors not finding pages then thats potential income that is as good as gone. Many non-technical people who surf the net that I've spoken to have a faint if not pretty clear idea that 404 is associated with a page that was supposed to be there but not.

With a 301 all you're actually doing is telling Apache (the software that turns your computer in to a web-server) that when a request for the first file is made to redirect the user to the second specified file.

I have renamed my entire site's files a few times in the past and when I first began setting up 301s at one point I had over 90,000 301s in a single month! That means 90,000+ people were redirected to the correct URL instead of hearing Bender's earthly patriotism. Now imagine if I was selling something...