【发布时间】:2015-04-01 10:30:33
【问题描述】:
我遇到了 Wamp 服务器和 URL 重写的问题。 我已经使用他的 .htaccess 从生产服务器导入我的项目。 URL 重写在生产环境中可以正常工作,但在 localhost 中却不行。
在我的 Wamp 配置中,rewrite_module 已激活。在 httpd.conf 中:
<Directory "c:/wamp/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.4/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:
# AllowOverride FileInfo AuthConfig Limit
#
AllowOverride all
#
# Controls who can get stuff from this server.
#
# onlineoffline tag - don't remove
# Require local
Allow from all
</Directory>
但是,在我的网站上,链接 http://localhost/conditions 返回 404 错误。 我的 .htaccess :
Options +FollowSymlinks
RewriteEngine on
# Conditions
RewriteRule ^conditions pages/conditions.php [L]
所有文件都在 wamp 的根目录 (c:/wamp/www/)。
帮助:(
【问题讨论】:
-
可能的拼写错误?
RewriteRule ^conditions$ /pages/conditions.php [L]。我刚醒来,你知道的;) -
您的 .htaccess 在
C:/的什么位置?
标签: .htaccess url url-rewriting rewriting