473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Redirect on "error 404 page not found"

HI fellow php fans,

I am blocked with a simple problem, at least it seems simple,
but I cannot make it through.
I want to execute a .php script in case of "error 404, page not
found".
I am not yet on a production server but on my local Apache server.

I have defined my personal error file.
I have modified the apache configuration httpd.conf to point to this
file (see below).

QUOTE
#
# Customizable error response (Apache style)
# these come in three flavors
#
# 1) plain text
#ErrorDocument 500 "The server made a boo boo.
# n.b. the single leading (") marks it as text, it does not get
output
#
# 2) local redirects
#
# RCB 10.9.2004
#
ErrorDocument 404 /gfmer_404.php
#ErrorDocument 404 /missing.html
#
# to redirect to local URL /missing.html
#ErrorDocument 404 /cgi-bin/missing_handler.pl
# N.B.: You can redirect to a script or a document using
server-side-includes.

UNQUOTE

When I try to load a non-existing page, it never comes to my above
defined gfmer_404.php file.
The standard error file-not-found is always displayed.

Do I miss something somewhere ?
Tks very much for your precious help.

RCB845
Jul 17 '05 #1
6 2896
> I have defined my personal error file.
I have modified the apache configuration httpd.conf to point to this
file (see below).


... and you did think of restarting your server, right?

Gert
Jul 17 '05 #2
On 13 Sep 2004 01:43:36 -0700, rc****@yahoo.fr (rc****@yahoo.fr)
wrote:

<using custom error page in apache>

When I try to load a non-existing page, it never comes to my above
defined gfmer_404.php file.
The standard error file-not-found is always displayed.


By "standard error file-not-found" do you mean the page Internet
Explorer shows? In that case try adding some extra code to your custom
page (for example some html-comments with some text in it).
Internet Explorer ignores custom error documents that are less than
512 bytes...
HTH,
B.

Jul 17 '05 #3
"Gert" <ge**@mellak.com> wrote in message news:<ci**********@newsreader1.utanet.at>...
I have defined my personal error file.
I have modified the apache configuration httpd.conf to point to this
file (see below).


.. and you did think of restarting your server, right?

Gert

Tks for the info, but YES I restarted the server
RCB845
Jul 17 '05 #4
*** rc****@yahoo.fr escribió/wrote (13 Sep 2004 01:43:36 -0700):
When I try to load a non-existing page, it never comes to my above
defined gfmer_404.php file.
The standard error file-not-found is always displayed.


Check whether there's another ErrorDocument directive overriding yours.
Also, please note Internet Explorer doesn't display short error pages by
default: you have to uncheck "Show descriptive messages on http errors" (or
similar text, I'm translating from Spanish) in Internet Options.
--
-+ Álvaro G. Vicario - Burgos, Spain
+- http://www.demogracia.com (la web de humor barnizada para la intemperie)
++ Las dudas informáticas recibidas por correo irán directas a la papelera
-+ I'm not a free help desk, please don't e-mail me your questions
--
Jul 17 '05 #5
Tks to all of you for your advices.
I think, the error I made, was that the personal
error file was not in the root directory of easyphp, but
in another directory.

Now I changed, I put it in the root directory with
a redirection to the personal file I want.

Problem is solved, tks very much
RCB845
Jul 17 '05 #6


"Alvaro G. Vicario" wrote:

*** rc****@yahoo.fr escribió/wrote (13 Sep 2004 01:43:36 -0700):
When I try to load a non-existing page, it never comes to my above
defined gfmer_404.php file.
The standard error file-not-found is always displayed.


Check whether there's another ErrorDocument directive overriding yours.
Also, please note Internet Explorer doesn't display short error pages by
default: you have to uncheck "Show descriptive messages on http errors" (or
similar text, I'm translating from Spanish) in Internet Options.


The easiest way around this is to make sure your page is more than 512 bytes.
IE should display custom error pages bigger than that.

NOTE: The 512 doesn't include images, css or js files. Nor does it include PHP
code, obviously. I put a bunch of "&nbsp;" in my 404s to pad them above that
limit.

Shawn

--
Shawn Wilson
sh***@glassgiant.com
http://www.glassgiant.com
Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matt | last post by:
I was wondering if someone could explain why I'm receiving this error. It's like a 404 error but I think it might be something else. Basically, I have a page where a user inputs his email...
6
by: Meya | last post by:
Hi, when I hit my http://<domain name> site,I am getting this error msg: I have also installed my SSL cert on the IIS 5.0 ******************************** The page must be viewed over a...
3
by: Ari Royce Hidayat | last post by:
Dear ALL, Is there some one ever faces this problem? And fix it? The scenario is: There's an html page that hosts a .net object (using object tag), and this page opens the second html page...
0
by: Ari Royce Hidayat | last post by:
Tx a lot for idea. I've tried it, and still get not clue what causes it. I also tried to see the log file generated by IEHost (by adding IEHostLogFile to registry) and still get not clue what...
4
by: dlsan | last post by:
Hello to everybody. I'm working in Italy on this website http://www.fondazioneantonioruberti.it/ariene/ as css/xhtml/graphic designer in cooperation with a php programmer and a ISP provider....
4
by: Don Wash | last post by:
Hi All! I'm getting the following Error: No DLLs has been compiled yet and nothing in the \bin directory. So it is not the versioning problem or anything like that. And here are the...
9
by: Martin Eyles | last post by:
Hi, I have set up an asp.net website on another PC in order to test it. The site was fine on my PC, but on the new PC all the pages give the error "The Page Cannot Be Found". Some legacy pages...
0
by: RCM | last post by:
I am really eager to quit the Microsoft world and get into LAMP. For the immediate future I can't do the Apache part, so I am at least trying to get PHP up and running under IIS to learn it. I...
8
by: webgenius | last post by:
Whenever I click the SUBMIT button in my HTML page, I get the "Object not found!" error. It was working fine yesterday. This error started to occur after I installed Codelobster and made some changes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.