Detect a virtual directory????

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
schworak
Forum Newbie
Posts: 3
Joined: Wed Apr 25, 2012 2:33 pm

Detect a virtual directory????

Post 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???
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Detect a virtual directory????

Post 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.
Post Reply