Apache開啓.htaccess僞靜態支持配置方法

1. 檢查Apache是否加載了mod_rewrite模塊html

打開apache的配置文件httpd.conf,找到如下配置,把前面#去掉,沒有則添加。react

#LoadModule rewrite_module modules/mod_rewrite.so

2. 檢查Apache是否開啓.htaccess支持android

打開apache的配置文件httpd.conf,找到如下配置,把 AllowOverride None 換成 AllowOverride All 使apache支持 .htaccess 文件。apache

<Directory "D:/server/www">
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important.  Please see
    # http://httpd.apache.org/docs/2.2/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # 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>
相關文章
相關標籤/搜索