Simon Fredriksson wrote:
Sadly, none of your tips works.

__FILE__ shows the script filename, not to the path of the current dir. Where can I find out more about this kind of constants? Can't see it anywhere in the manual.

The problem is this:

DocumentRoot (/): D:/Web/htdocs/
Users (/~xxxxx/): D:/Web/users/
Stuff1 (/s1/): E:/Stuff1 # Alias in apache
Stuff2 (/s2/): D:/Stuff2 # Alias in apache

So when I surf to /s1/, the script in D:/Web/htdocs/list/lister.php is executed. Just aswell as it is when surfing to /s2/ or any other folder without any other indexfile. When surfing there, the only variable that is of any use to get the folder is $_SERVER['REQUEST_URI'], but it doesn't reveal the local path that I want.

Any ideas on how to solve it?

If you're running PHP as an Apache module, this may solve it: http://php.net/apache_lookup_uri


Pass it $_SERVER['REQUEST_URI'] and what you want should be in the filename part of the returned object (untested).

If you're not running PHP as an Apache module then I don't think there's any way to do it. Actually, now that I've typed that, doesn't the Apache 404 handler pass the requested URI to the 404 file? You might be able to use that.

--
Stuart

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to