【问题标题】:easyphp and .htaccesseasyphp 和 .htaccess
【发布时间】:2011-11-16 21:12:35
【问题描述】:

我需要 EasyPHP 和 .htaccess 方面的帮助。

.htaccess 文件不起作用,我认为是因为我没有使用 EasyPHP 进行设置。

我的 EasyPHP 版本是 5.3.8.1

也许有人知道如何解决这个问题?

.htaccess 文件:

Options +FollowSymlinks

RewriteEngine on

RewriteRule ^get/([^/]+) /func/get.php?link=$1 [NC]

【问题讨论】:

  • 是否启用 mod_rewrite?是否允许全部覆盖?

标签: .htaccess easyphp


【解决方案1】:

在 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

    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

【讨论】:

  • 这实际上是正确的答案,但您必须添加它,之后您必须重新启动 EasyPhp 或至少重新启动 Apache。
  • 是的。我认为您应该知道任何配置更改都需要重新启动。感谢您的评论!
【解决方案2】:

在本地网站上工作时,我通过将网站路径(使用 .htaccess)添加为虚拟主机来解决此问题。 Easyphp 为此提供了一个模块:'Virtual Hosts Manager'。这将自动处理 httpd.conf

【讨论】:

  • 你是怎么做到的?请发布实际解决方案
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多