我需要EasyPHP和.htaccess的帮助。
.htaccess文件无效,我认为是因为我没有使用EasyPHP设置。
我的EasyPHP版本 5.3.8.1
也许有人知道如何解决这个问题?
.htaccess文件:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^get/([^/]+) /func/get.php?link=$1 [NC]
答案 0 :(得分:6)
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
答案 1 :(得分:1)
在本地网站上工作时,我通过将网站路径(使用.htaccess)添加为虚拟主机来解决此问题。 Easyphp有一个模块:'Virtual Hosts Manager'。这将自动处理 httpd.conf 。