.htaccess "Options not allowed here"

81,224

Solution 1

Note that this is a XAMPP-specific issue. XAMPP loads some additional configuration files located in XAMPP/etc/extra/ that override httpd.conf. For me the offending file is http-userdir.conf which applies rules for ~user requests and contains the line AllowOverride FileInfo AuthConfig Limit Indexes and changing that line to AllowOverride All did indeed solve my issue.

This only applies to files served from your /Sites/ directory on OS X. I don't know if the Windows version uses UserDir at all or even has a similar rule.

Solution 2

in my case I end up with change the line AllowOverride AuthConfig FileInfo to AllowOverride All in file httpd-vhosts.conf where this file is located in apache\conf\extra folder

Solution 3

You have to allow overrides for "Options" within directory context. there's no need to:

vhost/directory config:
    AllowOverride All

But only to permit overrides for 'Options':

    AllowOverride {Existing options to override} +Options

Solution 4

I guess there is a global AllowOverride setting in your apache config which disallows this. Can you grep for AllowOverride in your httpd.conf?

Solution 5

I just installed the most recent version of XAMPP and thought to share how I solved the same problem.

This is a XAMPP specific setting (with every new XAMPP install). The most recent up to date XAMPP as of today - XAMPP 1.8.3 have a setting in /xampp/apache/conf/extra/httpd-xampp.conf that's causing your "Server Error" message.

And then you get the following error in your error log:

.htaccess: Options not allowed here

Open /xampp/apache/conf/extra/httpd-xampp.conf and find:

<Directory "/xampp/htdocs/xampp">
    <IfModule php5_module>
        <Files "status.php">
            php_admin_flag safe_mode off
        </Files>
    </IfModule>
    AllowOverride AuthConfig
</Directory>

and change

AllowOverride AuthConfig

with

AllowOverride All

No authentication or authorization will be required after the change UNLESS you specify it in your httpd.conf, extra confs or in .htaccess.

You may also want to read the Apache documentation for the option AllowOverride http://httpd.apache.org/docs/current/en/mod/core.html#allowoverride and choose more optimal and secure setting that will allow you to use your .htaccess without causing a server error.

Also keep in mind that you can find a better place to rewrite the rule above depending on the results that you'd like to achieve. In my case this is a satisfactory change.

Share:
81,224
MrB
Author by

MrB

Updated on July 09, 2022

Comments

  • MrB
    MrB almost 2 years

    I have this in my .htaccess:

    Options +FollowSymLinks

    And I get the following error in the apache error_log:

    .htaccess: Options not allowed here
    

    Here's the part from my httpd.conf file:

    #htdocs symlinks here
    <Directory /Users/you/code/my/folder>
        Options All
        AllowOverride All
    </Directory>
    
    <Directory />
        Options All
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    
    <Directory "/Applications/XAMPP/xamppfiles/htdocs">
        Options All 
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    

    So I'm setting Options All and AllowOverride All everywhere, but STILL I'm not allowed to set the option. Can anyone make sense of this?

    Thanks, MrB