我们正在从 Joomla 1.5 升级到 Joomla 3.0,并且有一个停产的 Podcast 模块。
我编写了自己的版本(它已经过测试并且可以工作),但现在我需要将旧的播客 URL 重定向到新的。
我尝试将此行放在 中.htaccess,但它不起作用。为什么?
Redirect 301 http://oar2.org/index.php?option=com_podcast&view=feed&format=raw&Itemid=100 http://oar2.org/rss.php
假设您在语句 ( ) 中获得了正确的 from URL和to URL,那么您错过的重要一点是您无法使用指令匹配查询字符串(查询字符串是以 开头的所有内容) . 您需要使用 mod_rewrite 的变量:RedirectRedirect <from> <to>Redirect?%{QUERY_STRING}
RewriteEngine On
RewriteCond %{QUERY_STRING} ^option=com_podcast&view=feed&format=raw&Itemid=100$
RewriteRule ^index.php$ /rss.php? [L,R=301]