【发布时间】:2014-02-04 18:48:09
【问题描述】:
我有 wampserver 2.4,但我似乎无法让 Mod_Rewrite 对其进行处理。我在 Apache 服务中启用了它,并在 httpd.conf 中取消了 mod_rewrite.so 的注释并重新启动了服务器。我还检查了我的 phpinfo(),它在服务下列出了 mod_rewrite。
我正在测试它的站点位于地址 localhost/eb/index.php 后面我试图在 event.php 页面上测试它,其中 url 看起来像 localhost/eb/event.php?id=1
这就是我的 .htaccess 文件在我的 index.php 文件所在的 localhost/eb 根目录中的样子。
<IfModule mod_rewrite.so>
RewriteEngine on
RewriteBase /eb/
RewriteRule ^event/([0-9]+)/?$event.php?id=$1
</IfModule>
即使在此之后它仍然显示 url localhost/eb/event.php?id=1
【问题讨论】:
标签: apache .htaccess mod-rewrite wamp