将index.php url重定向到根域 - 无法正常工作

时间:2014-08-16 07:02:44

标签: php .htaccess redirect

亲爱的stackoverflow社区用户,

这里我对网址重定向问题有点麻烦。

现在我的网页网址为index.php(http://www.mystore.com/index.php),我正在尝试使用htacess文件将其重定向到根域。

我将正确的代码放入htacess文件中但是如果我将其留空则似乎也不起作用。它似乎也不起作用,网站也将打开http://www.mystore.com/index.php网址。

我怎样才能做到正确?

1 个答案:

答案 0 :(得分:0)

你可以试试下面的代码吗?

<IfModule mod_rewrite.c>
    Options -MultiViews

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [QSA,L]
</IfModule>