我有这样的网址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 不支持它,因为我以前不知道。
有人可以帮我解决这个问题吗?