How to Set AllowOverride all

前端 未结 11 1391
忘掉有多难
忘掉有多难 2020-11-22 10:17

I want to set the AllowOverride all But I don\'t know how to do it. I have found the following code by searching the google and pasted it in .htaccess

相关标签:
11条回答
  • 2020-11-22 10:47

    On Linux, in order to relax access to the document root, you should edit the following file:

    /etc/httpd/conf/httpd.conf
    

    And depending on what directory level you want to relax access to, you have to change the directive

    AllowOverride None
    

    to

    AllowOverride All
    

    So, assuming you want to allow access to files on the /var/www/html directory, you should change the following lines from:

    <Directory "/var/www/html">
     AllowOverride None
    </Directory>
    

    to

    <Directory "/var/www/html">
     AllowOverride All
    </Directory>
    
    0 讨论(0)
  • 2020-11-22 10:48

    If you are using Linux you may edit the code in the directory of

    /etc/httpd/conf/httpd.conf
    

    now, here find the code line kinda like

    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   Options FileInfo AuthConfig Limit
    #
        AllowOverride None
    #
    # Controls who can get stuff from this server.
    #
        Order allow,deny
        Allow from all
    
    </Directory>
    

    Change the AllowOveride None to AllowOveride All

    Now now you can set any kind of rule in your .httacess file inside your directories if any other operating system just try to find the file of httpd.conf and edit it.

    0 讨论(0)
  • 2020-11-22 10:48

    I think you want to set it in your httpd.conf file instead of the .htaccess file.

    I am not sure what OS you use, but this link for Ubuntu might give you some pointers on what to do.

    https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles

    0 讨论(0)
  • 2020-11-22 10:48

    SuSE Linux Enterprise Server

    Make sure you are editing the right file https://www.suse.com/documentation/sles11/book_sle_admin/data/sec_apache2_configuration.html

    httpd.conf

    The main Apache server configuration file. Avoid changing this file. It primarily contains include statements and global settings. Overwrite global settings in the pertinent configuration files listed here. Change host-specific settings (such as document root) in your virtual host configuration.

    In such case vhosts.d/*.conf must be edited

    0 讨论(0)
  • 2020-11-22 10:57

    Goto your_severpath/apache_ver/conf/ Open the file httpd.conf in Notepad.

    Find this line:

    #LoadModule vhost_alias_module modules/mod_vhost_alias.so

    Remove the hash symbol:

    LoadModule vhost_alias_module modules/mod_vhost_alias.so

    Then goto <Directory />

    and change to:

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

    Then restart your local server.

    0 讨论(0)
  • 2020-11-22 11:00

    As other users explained here about the usage of allowoveride directive, which is used to give permission to .htaccess usage. one thing I want to point out that never use allowoverride all if other users have access to write .htaccess instead use allowoveride as to permit certain modules.

    Such as AllowOverride AuthConfig mod_rewrite Instead of

    AllowOverride All
    

    Because module like mod_mime can render your server side files as plain text.

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