.htaccess “Options not allowed here”

前端 未结 9 1380
旧巷少年郎
旧巷少年郎 2021-01-01 12:07

I have this in my .htaccess:

Options +FollowSymLinks

And I get the following error in the apache error_log:

.htaccess: Options not allowed he         


        
相关标签:
9条回答
  • 2021-01-01 12:13

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

    0 讨论(0)
  • 2021-01-01 12:14

    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

    0 讨论(0)
  • 2021-01-01 12:22

    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.

    0 讨论(0)
  • 2021-01-01 12:28

    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
    
    0 讨论(0)
  • 2021-01-01 12:28

    instead of changing the global AllowOverride settings in your main httpd.conf file, if you have a httpd-vhosts.conf file you would want to put directory specific AllowOverride All directives in each host entry that you need it in, so you can keep a restrictive set on the rest of the server realm.

    0 讨论(0)
  • 2021-01-01 12:31

    Does the server your domain is hosted on fulfills all requirements needed for Elgg? Especially, is mod_rewrite available?

    Re-check all steps you had done.

    If mod_rewrite is working... Do you have access to the configuration (http.conf) of Apache on your server? If yes, add the following lines (adjust the path):

    AllowOverride All

    0 讨论(0)
提交回复
热议问题