custom 404 redirection

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
train
Forum Commoner
Posts: 27
Joined: Wed Aug 16, 2006 3:58 pm
Contact:

custom 404 redirection

Post by train »

Hi,

If I wanted to (via a plugin, or cooperation with an ISP, or some other way) have people redirected to a page of my choosing whenever they received a 404 error, how could this be done?

Even if I do not have access to the files on the server that is handing out the 404's, is there a way to have the browser recognize that it is a 404 and redirect to another page?

I appeciate your input and ALL ideas.

Thanks so much.

Terrance
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There are several Apache directives (and IIS ones too) that can control the behavior of the server when a 404 is encountered. If you do not have access to the main configuration, you can possibly use mod_rewrite or equivalent to detect the nonexistent file or directory.

If you want to know more about the mod_rewrite directives needed, search through our Installation and Configuration board. I know at least one post that had directives specifically for this.
User avatar
train
Forum Commoner
Posts: 27
Joined: Wed Aug 16, 2006 3:58 pm
Contact:

Post by train »

feyd wrote:There are several Apache directives (and IIS ones too) that can control the behavior of the server when a 404 is encountered. If you do not have access to the main configuration, you can possibly use mod_rewrite or equivalent to detect the nonexistent file or directory.

If you want to know more about the mod_rewrite directives needed, search through our Installation and Configuration board. I know at least one post that had directives specifically for this.
Right, but I do not have access to the web sever.

I only have available to me what is available to the client.

It is a puzzle. I was thinking java applet network sniffer to catch the HTTP return code and then do whatever?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

If your web server is Apache, you can use .htaccess files quite often. Many hosts have mod_rewrite enabled for their users too.
User avatar
train
Forum Commoner
Posts: 27
Joined: Wed Aug 16, 2006 3:58 pm
Contact:

Post by train »

feyd wrote:If your web server is Apache, you can use .htaccess files quite often. Many hosts have mod_rewrite enabled for their users too.
I am not being clear, I guess...

We have access to client browsers only. We are not in control of any web servers whatsoever. This has to be entirely client-side.

I was thinking that somehow we could grab the HTTP return codes and do something if we see 404?

But how?

Thanks a lot!!!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Not possible.
Post Reply