Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a muluitple vhosts set up all with the same DocumentRoot pointing to a common set of files, I have set up AliasMatch for for the bespoke files on each site, I was wondering if I can have a .htaccess file for each vhost.

#Sample vhost
    DocumentRoot /home/commonfiles/public_html
    AliasMatch /css/(.*) /home/ftpuser/public_html/mycss/$1

#Sample vhost 2
    DocumentRoot /home/commonfiles/public_html
    AliasMatch /css/(.*) /home/ftpuser2/public_html/mycss/$1

I have added in an AliasMatch for the .htaccess but that didn't work.

#vhost 1
AliasMatch /.htaccess /home/ftpuser/public_html/.htaccess
#vhost 2
AliasMatch /.htaccess /home/ftpuser2/public_html/.htaccess

Any suggestions?

Thanks in advance.

share|improve this question
I take it that you're not aware that aliases only apply to requested files, not Apache-internal files? – womble Nov 16 '09 at 15:00
I am now, this is all kinda new to me. Trying to learn as I go. – icelizard Nov 16 '09 at 15:01

I doubt that's going to work, the override stuff is probably happening beforehand. I'm not 100% here without wading through documentation.

What I'd do though is look at the AccessFileName directive which can be specified per VirtualHost.

Specify a different AccessFileName in the two VirtualHosts and you should be good to go. Bear in mind, this will change the filename Apache looks for override directives for all sub-directories accessed via that VirtualHost also.

share|improve this answer
AccessFileName is precisely what he needs :) – Nerdling Nov 16 '09 at 17:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.