By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,543 Members | 2,246 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,543 IT Pros & Developers. It's quick & easy.

PHP 404 document's REQUEST_URI does not hold expected value in $_ENV and $_SERVER

P: n/a
Hello,

I wanted to migrate some custom 404 error pages from
shtml to php for the ease of email notification of lost pages.
However when PHP processes the page $_ENV['REQUEST_URI']
and $_SERVER['REQUEST_URI'] both now hold the error page eg "404.php".

Does anyone have advice on how to dodge this? Should I just continue to use
shtml error pages and
do an shtml include on a little php script to do the mail?

Any advice?

TIA

jg
Jul 17 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
jerrygarciuh <de*****@no.spam.nolaflash.com> wrote:
I wanted to migrate some custom 404 error pages from
shtml to php for the ease of email notification of lost pages.
However when PHP processes the page $_ENV['REQUEST_URI']
and $_SERVER['REQUEST_URI'] both now hold the error page eg "404.php".

Does anyone have advice on how to dodge this?


All I can tell you is that in my setup above works as you desire.

Tell us a little more about your setup.

The only thing I do in Apache is a .htaccess with:
ErrorDocument 404 /404.php

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
Daniel,

Thanks for the response. Unsure what the issue was but twmtowtdi.

Solved like so:

// in 404.shtml

<!--#include virtual="./missing.php?uri=${REQUEST_URI}" -->

// mail done by php

Thanks!

jg
"Daniel Tryba" <ne****************@canopus.nl> wrote in message
news:cm**********@news.tue.nl...
jerrygarciuh <de*****@no.spam.nolaflash.com> wrote:
I wanted to migrate some custom 404 error pages from
shtml to php for the ease of email notification of lost pages.
However when PHP processes the page $_ENV['REQUEST_URI']
and $_SERVER['REQUEST_URI'] both now hold the error page eg "404.php".

Does anyone have advice on how to dodge this?


All I can tell you is that in my setup above works as you desire.

Tell us a little more about your setup.

The only thing I do in Apache is a .htaccess with:
ErrorDocument 404 /404.php

--

Daniel Tryba

Jul 17 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.