Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
1  
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
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.