Thanks for this David, i was using REQUEST_URI and other $_SERVER info
and mixed that together. It worked in some situations but on hosted
servers (like GoDaddy and others like that where they use a
complicated directory setup) it does not work.

Olafur Waage

2008/8/23 David Otton <[EMAIL PROTECTED]>:
> 2008/8/23 Ólafur Waage <[EMAIL PROTECTED]>:
>
>> Robert, thanks for the reply but i had tried __FILE__ and __DIR__
>> (which is dirname(__FILE__)) but it doesnt work.
>>
>> And thanks for the reply also Ashley but as i said in my first post, i
>> had tried $_SERVER with limited results
>
> If checking the output of phpinfo() doesn't help (and it looks like it
> won't), I'd suggest starting with REQUEST_URI, then, if you know where
> your webroot is, you should be able to calculate the path to the
> target directory ("/var/www/example/../test/" in your original
> example) by gluing bits of path together. Hardly an ideal solution as
> it needs configuration, but it would work.
>
> I think this is really a mod_rewrite problem, as by the time PHP takes
> over you've lost the information you need. You may have better luck in
> a forum devoted to mod_rewrite, but I'm not optimistic that it has a
> "what file would have handled this request if mod_rewrite hadn't run"
> parameter. I think you're going to have to build your directory path
> from the information in the original request and some configuration
> glue. Good luck
>
> (BTW, I initially thought there might be something in mod_autoindex to
> run a custom script, but it doesn't look like there is.)
>
> --
>
> http://www.otton.org/
>

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

Reply via email to