1

我一直在尝试重写网址。这是我的 httpd.conf 中的内容

<Directory "C:\wamp\www\base">
    Options None
    AllowOverride all
    Order deny,allow
    Allow from all
    Satisfy all
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory C:\wamp\www\base>
    #
    # 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 all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Options None
    AllowOverride all
    Order Deny,Allow
    Allow from all
    Allow from 127.0.0.1

</Directory>

来自 apache 的错误日志:-

error] [client 127.0.0.1] client denied by server configuration: C:/wamp/www/base/category

基本目录下的 .htaccess 文件

Options +Indexes
Options +FollowSymLinks 
RewriteEngine On
RewriteBase /base/
RewriteRule ^category /category.php 

在我没有进行 url 重写之前。如果我从基本目录中删除 .htaccess,那么它工作正常。那么任何人都可以帮助我启用 url 重写吗?

4

0 回答 0