如何将“ domain.com/dir”重定向到“ domain.com/auction-view.php?v=dir”?

时间:2019-05-02 10:53:16

标签: apache .htaccess

我在共享主机上有一个网站,需要这样的url重定向:

**www.domain.com/** goes to **www.domain.com/index.php**

**www.domain.com/post_title** goes to **www.domain.com/auction-view.php?v=post_title**

**www.domain.com/about-us.php** goes to **www.domain.com/about-us.php**

我使用了以下规则,但返回“重定向次数过多”错误:

RewriteEngine on
RewriteRule ^/?$ index.php [R=301]
RewriteRule ^(.*(php))$ $1 [R=301]
RewriteRule ^(.*)$ /auction-view.php?v=$1 [R=301,L]

有人能对此有所了解吗?

非常感谢!

0 个答案:

没有答案