473,399 Members | 3,656 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,399 software developers and data experts.

$_SERVER['REQUEST_URI']', Apache 1.x/2.x IIS 5/6

Hi,

When I have a page not found in Apache I can have it redirected to a custom
../error.php file and I can use $_SERVER['REQUEST_URI'] to get the file that
was not found.

But as some of you might know, IIS does not have '$_SERVER['REQUEST_URI']'.

So what is a 100% secure way of finding the path of the requested uri using
IIS?

What I was thinking of doing is

if $_SERVER['REQUEST_URI'] exists the return it
else
if $_SERVER[QUERY_STRING'] exists strip the relevant info from it and return
the data
but how do I know for certain what the format will be? in my case,
(IIS6) I get
$_SERVER[QUERY_STRING'] =
404;http://www.example.com/unknown_page.php?var1=12&var2=14
but it that the case for all of them? shall I return anything after
'404;'?
else
return self?

I obviously did a search on google, but most example/work around just don't
work or don't achieve the expected result.

Many thanks.

Simon


Jul 17 '05 #1
0 1746

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

Similar topics

9
by: Jez | last post by:
Any ideas why I'm not able to use $_SERVER on my shared hosting account (PHP 4.1.2), but I can on my local server (PHP 4.3.3)? I imagine it has something to do with the different versions of PHP...
2
by: jerrygarciuh | last post by:
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 and $_SERVER both now hold...
12
by: Don | last post by:
What's the PHP equivalent for the following? if(window.location == "http:/site.com/page1.html") { } else { }
10
by: Jim Carlock | last post by:
Looking for a way to extract the path from the pfqpn (partially full qualified path name). $sThisServer = $_SERVER; // returns either aquaticcreationsnc.com or www.aquaticcreationsnc.com ...
1
by: Adam | last post by:
I hope I'm not doing something really stupid .... but I can't get this to work properly. I'm using $_SERVER to get the name of the *referring* page for use in a custom 404 page. All works...
5
by: Jeremy | last post by:
At some point, $_SERVER started including the query string. It seems to me that it didn't do this before. Example: for URL "http://www.foo.bar/path/script?thing=value" $_SERVER should be...
2
by: Flava18 | last post by:
I recently switched servers and now my $_SERVER variables don't seem to be working - they simply just don't give anything back. I'm trying to use: $url = $_SERVER; Worked on my old server, but...
5
by: Jim Carlock | last post by:
(1) test.php?test_key=test_value $_SERVER returns /test/test.php $_SERVER returns /test/test.php?test_key=test+value $_SERVER returns test_key=test+value (2)...
5
watagal
by: watagal | last post by:
Greetings I'm writing an error handling page for the common "404 Page Not Found" error using PHP. I need to retrieve the actual URL that was typed by the user. When I use $_SERVER - it...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...
0
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...

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.