Welcome to WebmasterWorld Guest from 54.198.87.238

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

404 error handling with PHP & IIS

IIS displaying full error page path?

     
2:53 pm on Aug 9, 2005 (gmt 0)

10+ Year Member



Hi,
I'm using a 404 script to handle errors and hand the user back off to a sensible page. This works fine under IIS5, Apache, but my host is using IIS6 (and php 4.3), and whenever the script is called into action, the user sees :

domainname/phpscript.php?404;http://domainname/fullpath/to/the/badurl

Has anybody seen this behaviour before? I can't replicate it on my local machine(s) - is it an IIS or PHP issue?

How can it be solved?

TIA

6:33 pm on Aug 9, 2005 (gmt 0)

5+ Year Member



I could be wrong, not knowing your script;
but I see a value with no variable name.

should it be
?404=http://domainname/fullpath/to/the/badurl
or
?err=404;http://domainname/fullpath/to/the/badurl
?

just a thought, and likely wrong since you said it worked before.

Are your register_globals on?

8:33 pm on Aug 9, 2005 (gmt 0)

10+ Year Member



Sorry, I should have been a bit more explicit.

I'm using a 404 page to help generate SEO friendly URLs, and then generate the page from the database. Its the poor mans way of doing it without the luxury of mod_rewrite.

In the past, i've done this in ASP, and the user never sees the 404 page, the browser continues to display the link as clicked on, rather than displaying the error page url. This is the desired behavior.

I've now implemented it in PHP instead, but on my live host, the user sees something like :
404.php?404;http://somehost:port/directory/linkclickedon
in the address bar - really *not* what I want!

I suspect it's down to the inept nature of my hosting provider, but I'd like to be sure - has anybody come across this before (with either PHP or ASP)?

<added>No, register globals aren't on</added>

 

Featured Threads

Hot Threads This Week

Hot Threads This Month