473,748 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2916
> 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.f r)
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.co m> 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***@glassgian t.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
2530
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 address. The system is supposed to look up the email address and send the associated password to that email address. It worked up until a few months ago. Note that the validation works. So, if the user tries to submit a blank text box, it returns...
6
3893
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 secure channel Please try the following:
3
6087
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 that also hosts a .net object (e.g. by click a hyperlink).
0
1708
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 causes. It seems normal instead that before loading the second page (in third row from last row) there's a text read as:
4
3281
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. The site is still in test but i'm having no answer from http://validator.w3.org/ except "302 found" for this page http://www.fondazioneantonioruberti.it/ariene/ and also
4
2719
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 source of the files...
9
6158
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 (ASP, as opposed to ASP.Net) work fine. The old PC was running Windows 2000 Server, and the new PC I am testing on is running Windows Server 2003. Thanks in advance,
0
1955
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 used the windows installer .msi to install PHP on a WinXP pro machine with IIS 5.1. My current problem is that when I access a test page as in http://localhost/simple.php I get the message "The specified module could not be found."
8
3272
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 to the php file CheckLogin.php. This is a small part of the HTML page with the button: When I enter the username and password and click on the Submit button, I get the error: Plase help me on this.
0
8830
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9370
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.