Tom
Tom

Reputation: 12998

500 Error on apache server - "AllowOverride not allowed here"

I have set up a server on my Mac (OSX 10.9) but it's returning a 500 error with the following message in the error log…

[alert] [client ::1] /Users/user/Sites/mysite/.htaccess: AllowOverride not allowed here

Here's the code in my .htaccess file

Options +FollowSymLinks -MultiViews
AllowOverride All

# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteMap lc int:toLower
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule (.*) ${lc:$1} [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^i/(.*)/(.*)-(.*)$ /items/?id=$1&range=$2&type=$3 [L,QSA,NC]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^c/(.*)$ /category/?menu=$1 [L,QSA,NC]

And here's the relevant httpd.conf code (let me know if there's anything else that would help)

DocumentRoot "/Users/user/Sites/mysite"

<Directory />
    Options FollowSymLinks
    AllowOverride All
    Order deny,allow
    Deny from all
</Directory>

<Directory "/Users/user/Sites/mysite">
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Any ideas?

Upvotes: 5

Views: 31336

Answers (3)

Dave
Dave

Reputation: 3658

Take AllowOverride All out of your .htaccess file.

Upvotes: 0

nihylum
nihylum

Reputation: 528

AllowOverride controls .htaccess security and behaviour and cannot be set inside of .htaccess itself.

Remove AllowOverride All from the .htaccess file, that's all.

Upvotes: 2

Jon Lin
Jon Lin

Reputation: 143906

AllowOverride All doesn't belong in the htaccess file. It's used in the server config (httpd.conf) to set what an server config parameters an htaccess file can override. So obviously, it would be wrong to be able to configure what parameters htaccess files can override from within htaccess files.

Remove it from your htaccess file. You've already defined AllowOverride All in your httpd.conf in the right places.

Upvotes: 9

Related Questions