Page 1 of 1
Requested url with 404 error page
Posted: Tue Feb 03, 2004 4:33 pm
by kaYak
I want to do a 404 error page where if someone types in a bad url it will keep that url in the address bar instead of it saying the 404 error page's url. Does someone know how to do this? For example Google does this. Try typing in a weird url for Google like google.com/fdjdf or something and you will see what I mean.

Posted: Tue Feb 03, 2004 4:48 pm
by uberpolak
[google]mod_rewrite[/google]
You can use it to send all requests to one page, then that page will see where to go based on what the request was, without changing the URL for the client.
Posted: Tue Feb 03, 2004 5:02 pm
by kaYak
Could someone please give me the exact code because I have no clue which thing to use?
Posted: Tue Feb 03, 2004 5:19 pm
by uberpolak
There isn't really an "exact code" solution, it depends on your server. You have to do some reading and get a feel for using mod_rewrite.
Unfortunately, there's no dont_change_url_but_display_404(); function. This one's a little more complex.
Posted: Tue Feb 03, 2004 5:25 pm
by kaYak
Okay, thanks for your help