在Joomla htaccess中强制重定向到/index.php/url

时间:2019-03-19 11:05:32

标签: .htaccess mod-rewrite joomla

我有一个重写.htaccess URL的Joomla网站。因此,在Google中,我的链接显示为: DOMAIN / abc ... 现在,主机上的重写mod可能已停止工作,我需要将所有人从Google重定向到链接,例如: DOMAIN / index.php / abc ...

我尝试过

RewriteEngine On
RewriteRule ^(.*)$ https://example.com/index.php/$1 [R=301,L]

但它不起作用。

1 个答案:

答案 0 :(得分:0)

您应排除以index开头的请求,以避免循环,因此,请更改规则,如下所示:

RewriteEngine On
RewriteRule !^index\.php  https://example.com/index.php%{REQUEST_URI}  [R=301,L]

注意:清除浏览器缓存