EasyPHP和.htaccess

4
我需要帮助处理EasyPHP和.htaccess的问题。
我认为.htaccess文件无法正常工作,可能是因为我没有在EasyPHP中设置某些内容。
我的EasyPHP版本是5.3.8.1。
也许有人知道如何解决这个问题?
.htaccess文件:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^get/([^/]+) /func/get.php?link=$1 [NC]

2
mod_rewrite是否启用?它允许全部覆盖吗? - Book Of Zeus
2个回答

8
默认情况下,EasyPHP中Apache的安装未启用使用.htaccess文件修改文件夹中的服务器配置选项。您需要告诉Apache可以使用.htaccess文件更改哪些配置以及在哪个文件夹中更改。要在主Web服务器上启用所有配置更改,您应该编辑http.conf(位于Apache / conf文件夹中),并查找:
<Directory "${path}/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>

并更改

    AllowOverride None

to

    AllowOverride All

为了更好地调整它,请阅读有关AllowOverride的文档: http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride 另外,请检查http.conf是否已激活mod_rewrite,查找:
#LoadModule rewrite_module modules/mod_rewrite.so

去掉开头的“#”符号

LoadModule rewrite_module modules/mod_rewrite.so

1
这实际上是正确的答案,但你还需要补充一点,之后你必须重新启动EasyPhp或至少Apache。 - John Max
没错,我假设你应该知道任何配置更改都需要重新启动。感谢您的评论! - vicenteherrera

1
在本地网站工作时,我通过添加网站路径(使用.htaccess)作为虚拟主机来解决了这个问题。Easyphp有一个名为“Virtual Hosts Manager”的模块可供使用。它会自动处理httpd.conf文件。

2
你是怎么做到的?请发实际解决方案。 - John Max

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接