【问题标题】:Force redirect to /index.php/url in Joomla htaccess在 Joomla htaccess 中强制重定向到 /index.php/url
【发布时间】:2019-03-19 22:29:51
【问题描述】:

我有一个带有 .htaccess URL 重写的 Joomla 站点。所以在谷歌我的链接显示为: 域/abc ... 现在主机上的重写模块可能停止工作,我需要将所有人从谷歌重定向到链接,例如: 域/index.php/abc ...

我试过了

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

但它不起作用。

【问题讨论】:

  • 而“它不起作用”是什么意思究竟?怎么了?没什么,你看到一个空白页?您收到错误消息?哪个?是否应用了错误的重写?当你提出请求时,宇宙会崩溃吗?请在您的问题中准确
  • 这意味着我遇到了 500 错误。
  • http 状态 500 意义不大,它不携带任何真实信息,因为它仅适用于客户端......您需要查看您的 http 服务器错误日志文件,即您可以在其中阅读错误的实际原因。你创建了一个重写循环或者重写模块没有加载到http服务器中。

标签: .htaccess mod-rewrite joomla


【解决方案1】:

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

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

注意:清除浏览器缓存

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-21
    • 2014-08-31
    • 2015-07-16
    • 2012-01-06
    相关资源
    最近更新 更多