In httpd I have a main domain and sub domain like so;

<VirtualHost main:8080>
ServerName main
DocumentRoot "/Users/admin/Sites/main"
<Directory /Users/admin/Sites/main>
    #AllowOverride FileInfo Limit Options Indexes
    Options FollowSymLinks Indexes MultiViews
    AllowOverride All AuthConfig
    Order allow,deny
    Allow from all
</Directory>
</VirtualHost>

<VirtualHost sub.main:8080>
ServerName sub.main
DocumentRoot "/Users/admin/Sites/main/sub"
<Directory /Users/admin/Sites/main/sub>
    #AllowOverride FileInfo Limit Options Indexes
    Options FollowSymLinks Indexes MultiViews
    AllowOverride All AuthConfig
    Order allow,deny
    Allow from all
</Directory>

A dead simple .htaccess file is in both the main folder and sub folder with

RewriteEngine on

However, going to http://sub.main:8080 gives a 500 error. Server error log gives

[alert] [client 127.0.0.1] /Users/admin/Sites/main/.htaccess: RewriteEngine not allowed here

Deleting main's htaccess removes the error. How can I set it so that htaccess files exist in both folders?

link|improve this question
How are you seeing this line: /Users/admin/Sites/main/.htaccess, when the documentroot for sub.main is /Users/admin/Sites/main/sub ? Are you sure you are hitting sub.main and not main – Ram Prasad Mar 23 '11 at 19:12
try just using AllowOverride All – Ram Prasad Mar 23 '11 at 19:27
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.