Welcome to MobyThreads.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

404 errodocument not working for php files

 
   Web Hosting and Web Master Forums (Home) -> Apache RSS
Related Topics:
mod_bandwidth, not working on PHP files - Hello group. I have tried to use to Limit my It works fine on all other files than .php. I cant really figure out why, and cant really find anything in the manual. I am using Linux Debian (testing release) with Apache..

VHost Log files not working - I have vhosts defined as below but have not been able to get the site log files to work. Any and all log msgs are being saved in the root log files. I have tried using various paths to get the vhost logs to save in the vhost files but have not been..

Can't Get it working Right - I've made several attempts to install Apache, but could never get it to work right. I actually had it running priorly on an install of 4.0 but installed a new HDD. When I was image to new HDD got a virus or hacker attack, last..

SSI not working - Hello, I have a client who's web designer insists on using SSI includes. I have the server to allow SSI, but it seems not to work, no matter what I do. The include looks like this : --> Yet, when we..

PHP Working??? - I just set up apache 2.0.48 and PHP 4.3.4 and thought it was working well. I can pull up pages with .php and some parts of the code work such as date functions and includes (pretty much all I've tested so far) but when I try to use
Next:  Can't set application protection to high :(  
Author Message
John B

External


Since: Feb 23, 2005
Posts: 2



(Msg. 1) Posted: Wed Feb 23, 2005 11:38 pm
Post subject: 404 errodocument not working for php files
Archived from groups: alt>apache>configuration (more info?)

Hello

I have some 1&1 webspace. I use php files. I wanted to create a custom error
page and as per their help, I created a .htaccess file with a 404 redirect
to my error page.
This works OK for any URLs I try unless it has a php extension. If this is
the case, a generic 404 message is displayed. Their support team says that
they cannot fix this. Why?

In addition, they seem to have some system whereby if you type a URL where
the document name is correct, but the extension is wrong (eg index.phx
instead of php), it redirects to the correct page automatically. Whilst this
is OK normally, with certain URLs, it comes up with a 300 Multiple choices
error page with the following info:

The document name you requested (/whatever.phx) could not be found on this
server. However, we found documents with names similar to the one you
requested.

Available documents:

/whatever.php (common basename)


Any ideas?

Thanks

 >> Stay informed about: 404 errodocument not working for php files 
Back to top
Login to vote
Tim

External


Since: Feb 09, 2005
Posts: 67



(Msg. 2) Posted: Thu Feb 24, 2005 9:06 pm
Post subject: Re: 404 errodocument not working for php files [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Wed, 23 Feb 2005 23:38:14 -0500,
"John B" <spamfree RemoveThis @hotmail.con> posted:

 > I have some 1&1 webspace. I use php files. I wanted to create a custom error
 > page and as per their help, I created a .htaccess file with a 404 redirect
 > to my error page.
 > This works OK for any URLs I try unless it has a php extension. If this is
 > the case, a generic 404 message is displayed. Their support team says that
 > they cannot fix this. Why?

How about saying exactly how you've configured that, and a specific example
of addresses.

Ordinarily, you'd do something like:
ErrorDocument 404 /some/place/with/your/404/notice.html

Which isn't a "redirect" but merely the source for the 404 notice.

And is it a case of you're asking the webserver for something that's not
there, and getting a 404? Or are you asking something of the PHP system
and it's returning the error messages.

 > In addition, they seem to have some system whereby if you type a URL where
 > the document name is correct, but the extension is wrong (eg index.phx
 > instead of php), it redirects to the correct page automatically. Whilst this
 > is OK normally, with certain URLs, it comes up with a 300 Multiple choices
 > error page with the following info:
 >
 > The document name you requested (/whatever.phx) could not be found on this
 > server. However, we found documents with names similar to the one you
 > requested.

That's "content negotiation", if you don't need it, you may be able to
disable it via your .htaccess file ("Options -Multiviews"). Otherwise,
just be careful about how you name things.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.<!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: 404 errodocument not working for php files 
Back to top
Login to vote
John B

External


Since: Feb 23, 2005
Posts: 2



(Msg. 3) Posted: Thu Feb 24, 2005 9:07 pm
Post subject: Re: 404 errodocument not working for php files [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

OK here's some more info:

the .htaccess file is:
ErrorDocument 404 /errors/404.php

If I try to visit xxx.htm which does not exist (by typing it into a
browser), it goes to the error page OK


If I try to visit xxx.php which does not exist, it goes to a generic 404
error page -NOT my error page.

If I try to visit xxx.xxx which does not exist, it goes to the error page OK

It is only php pages which do not work.

How do I fix this?

Thanks

"Tim" <tim RemoveThis @mail.localhost.invalid> wrote in message
news:je2acndpfmfn.1sicxku4s7pt5$.dlg@40tude.net...
 > On Wed, 23 Feb 2005 23:38:14 -0500,
 > "John B" <spamfree RemoveThis @hotmail.con> posted:
 >
  > > I have some 1&1 webspace. I use php files. I wanted to create a custom
error
  > > page and as per their help, I created a .htaccess file with a 404
redirect
  > > to my error page.
  > > This works OK for any URLs I try unless it has a php extension. If this
is
  > > the case, a generic 404 message is displayed. Their support team says
that
  > > they cannot fix this. Why?
 >
 > How about saying exactly how you've configured that, and a specific
example
 > of addresses.
 >
 > Ordinarily, you'd do something like:
 > ErrorDocument 404 /some/place/with/your/404/notice.html
 >
 > Which isn't a "redirect" but merely the source for the 404 notice.
 >
 > And is it a case of you're asking the webserver for something that's not
 > there, and getting a 404? Or are you asking something of the PHP system
 > and it's returning the error messages.
 >
  > > In addition, they seem to have some system whereby if you type a URL
where
  > > the document name is correct, but the extension is wrong (eg index.phx
  > > instead of php), it redirects to the correct page automatically. Whilst
this
  > > is OK normally, with certain URLs, it comes up with a 300 Multiple
choices
  > > error page with the following info:
  > >
  > > The document name you requested (/whatever.phx) could not be found on
this
  > > server. However, we found documents with names similar to the one you
  > > requested.
 >
 > That's "content negotiation", if you don't need it, you may be able to
 > disable it via your .htaccess file ("Options -Multiviews"). Otherwise,
 > just be careful about how you name things.
 >
 > --
 > If you insist on e-mailing me, use the reply-to address (it's real but
 > temporary). But please reply to the group, like you're supposed to.
 >
 > This message was sent without a virus, please delete some files yourself.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: 404 errodocument not working for php files 
Back to top
Login to vote
Tim

External


Since: Feb 09, 2005
Posts: 67



(Msg. 4) Posted: Fri Feb 25, 2005 4:35 am
Post subject: Re: 404 errodocument not working for php files [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Thu, 24 Feb 2005 09:04:43 -0500,
"John B" <spamfree.DeleteThis@hotmail.con> posted:

 > the .htaccess file is:
 > ErrorDocument 404 /errors/404.php
 >
 > If I try to visit xxx.htm which does not exist (by typing it into a
 > browser), it goes to the error page OK

Sounds pretty normal. However, does the PHP parser work on PHP files
within the /errors/ directory? I'm assuming that part works, since you say
it gets the error page ok.

 > If I try to visit xxx.php which does not exist, it goes to a generic 404
 > error page -NOT my error page.

This sounds like an issue with the PHP system not the webserver, in the
sense that when you ask for a ????.php file you're asking for PHP to
generate what you want (there's an extra parsing process in the chain). So
it sounds like you want to ask someone about PHP rather than Apache (so I
can't help much more in that regards).

One other thing that springs to mind is it any php request that fails, or
just for php files in certain directories? Perhaps you don't have a global
error document. Is that .htaccess file in a parent directory for what
you're experimenting with, and is it overridden anywhere else.

--
If you insist on e-mailing me, use the reply-to address (it's real but
temporary). But please reply to the group, like you're supposed to.

This message was sent without a virus, please delete some files yourself.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: 404 errodocument not working for php files 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting and Web Master Forums (Home) -> Apache All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]