.htaccess 重写几个index.php?扎根

.htaccess 重写几个index.php?扎根,.htaccess,rewrite,.htaccess,Rewrite,如何在.htaccess中重写所有这些内容: /index.php /index.php?FeaturedMode=online /index.php?MembersMode=online /index.php?MembersMode=top /index.php?lang=en /index.php?lang=pl /index.php?skin=tmd062_new 根/ 我发现这个代码: RewriteCond %{THE_REQUEST} ^.*/index\.php RewriteR

如何在.htaccess中重写所有这些内容:

/index.php
/index.php?FeaturedMode=online
/index.php?MembersMode=online
/index.php?MembersMode=top
/index.php?lang=en
/index.php?lang=pl
/index.php?skin=tmd062_new
根/

我发现这个代码:

RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ /$1 [R=301,L]
但它只适用于index.php,我得到的是:/?lang=en等。 我需要更一般的解决方案:
谢谢

是否有其他不应重写到root的潜在查询字符串值,或者这只是对/?的一次全面重写?根据您刚刚发布的重写规则,唯一的问题是它无法删除查询字符串?要强制使用空白查询字符串覆盖它,请使用/$1?嗨,Michael,否-无其他查询字符串值。我将尝试您的解决方案。我仍然得到/?lang=pl。如何将其重写为/?如果没有index.php,只需/?lang=pl/确保浏览器没有缓存以前的重定向Firefox,这一点尤其糟糕。尝试其他浏览器。