0

我有这样的网址http://localhost/mysite/index.php?page=something,我只想http://localhost/mysite/something在主页上http://localhost/mysite/使用http://localhost/mysite/index.php.htaccess

下面是我在 .htaccess 文件中的代码:

<IfModule mod_rewrite.c>
    RewriteEngine On
    rewriterule ^([^-]+)$ index.php?page=$1[L]
</IfModule>

但它与以前的情况相同。我不知道我是否在上面的代码中写错了,或者我的 apache 不支持它,因为我以前不知道。

有人可以帮我解决这个问题吗?

4

2 回答 2

0

请参阅有关重写日志记录的文档并在此处提供输出,以便我们更好地为您提供帮助。

于 2012-07-14T15:15:10.333 回答
0

如果<IfModule mod_rewrite.c>失败,那么您没有在 apache 中编译重写模块,或者它没有加载。你的配置中有这个吗?

LoadModule rewrite_module modules/mod_rewrite.so

(或者如果<IfDefine>它周围有条件,请确保满足定义)

于 2012-07-21T05:31:14.337 回答