如何将 301 重定向 URL 如 "/index.php/page" 到 .htaccess 中的新网址



我替换了一个旧的Joomla!具有新网址的网站,并希望将选定的旧网址重定向到相应的新网址。乔姆拉!网站使用example.com/index.php/newsexample.com/index.php/about等网址,新网站使用example.com/latest-news.htmlexample.com/about-us.html等网址。在 .htaccess 中使用 RedirectPermanent 的简单重定向不起作用(可能是因为斜杠后面的部分是查询字符串,没有 URL 段)。我在网上搜索了一下,但没有找到答案。

有什么建议吗?

提前谢谢。

以下方法应该有效:

Redirect 301 /index.php/news http://example.com/latest-news.html

对于查询字符串,您是否查看过带有参数的 URL 的类似帖子 htaccess 301 重定向

最新更新