重写URL中的Word

时间:2012-01-01 15:11:39

标签: apache .htaccess mod-rewrite

我无法从网址中删除某个字词

我想从网址中删除“index”这个词,我只是不知道要执行此操作的代码。

我在考虑以下内容:

RewriteRule www.example.com/$ www.example.com/index/$1

对不起,我真的不能做更多。

先谢谢大家!

1 个答案:

答案 0 :(得分:0)

我猜你正在使用apache。

使用:

RewriteCond %{REQUEST_URI} ^\/index[\/]*$
RewriteRule (.*)$ / [QSA,L]
相关问题