views:

155

answers:

2

Is there an inbuilt way to read the active DirectoryIndex in .htaccess (or httpd.conf etc) with php?

Also, is there a way to determine which file the httpd will execute using PHP given a url if rewrites are being used?

Basically, given a URL, I want to use PHP to figure out which file the httpd would initially invoke.

Thank you.

A: 

The easist way I can think of is to use curl and make the real URL request to see what page it gives you back.

That way there is no guessing, you will know for a fact what page it gives you back.

elviejo
I'm a bit confused. Does this method help to determine which file was invoked on the server side? Thanks.
doctororange
This method is using php like a web browser. So it will return whatever text a normal browser would see when calling a page on that server. It will follow all the rewrite rules. Etc.It won't tell you what php script was executed. Just what result said script gave back.
elviejo
A: 

see apache_lookup_uri

Gremki