Page 1 of 1

Detect a virtual directory????

Posted: Sun May 20, 2012 10:01 am
by schworak
I have a framework with centralized plug in modules and several sites that are all using this same framework.

If a site adds a special virtual folder, I want to know that it is available. Is that possible? I am running PHP5 and Apache2 on Linux.

More details...

I have a module that can do several things and not all of my sites use all of the features. So rather than manually configuring each site in a config file (which I could do easily enough), I am just wondering if I can simply detect a virtual folder which has been configured in the Apache config file using code similar to this...

Alias /SPECIALFOLDER /my_web_folders/common/SPECIALFOLDER
<Directory /my_web_folders/common/SPECIALFOLDER>
allow from all
Options -Indexes
</Directory>


So can the existance of that ALIAS be detected by PHP???

Re: Detect a virtual directory????

Posted: Sun May 20, 2012 8:23 pm
by requinix
Not in any nice way. Aliasing is handled by Apache so you'd have to (a) send a request through Apache and find out where it goes or (b) scan the .htaccess for Aliases. Which, to reiterate, is not nice.