我替换了一个旧的Joomla!具有新网址的网站,并希望将选定的旧网址重定向到相应的新网址。老乔姆拉!网站使用example.com/index.php/news
或example.com/index.php/about
等网址,新网站使用example.com/latest-news.html
或example.com/about-us.html
等网址。在 .htaccess 中使用 RedirectPermanent
的简单重定向不起作用(可能是因为斜杠后面的部分是查询字符串,没有 URL 段)。我在网上搜索了一下,但没有找到答案。
有什么建议吗?
提前谢谢。
以下方法应该有效:
Redirect 301 /index.php/news http://example.com/latest-news.html
对于查询字符串,您是否查看过带有参数的 URL 的类似帖子 htaccess 301 重定向