2013-05-13 66 views
-1

我们正在从Joomla 1.5升级到Joomla 3.0,并且已经停产了Podcast模块。需要了解重定向

我写了我自己的版本(它已经过测试和工作),但现在我需要将旧的播客网址重定向到新版本。

我试过把这条线放在.htaccess,但它不起作用。为什么?

Redirect 301 http://oar2.org/index.php?option=com_podcast&view=feed&format=raw&Itemid=100 http://oar2.org/rss.php 

回答

1

假设你已经有了从URL正确到URLRedirect声明(Redirect <from> <to>),那么你已经错过了一些重要的是,你不能对阵查询字符串使用Redirect指令(查询字符串是以?开头的所有内容)。你需要使用mod_rewrite的%{QUERY_STRING}变量:

RewriteEngine On 
RewriteCond %{QUERY_STRING} ^option=com_podcast&view=feed&format=raw&Itemid=100$ 
RewriteRule ^index.php$ /rss.php? [L,R=301] 
+0

这太好了......它让我有90%的方式。发生的一件事是它使新的URL: http://oar2.org/rss.php?option=com_podcast&view=feed&format=raw&Itemid=100 如何使它最终只是:http:/ PS:感谢LOADS给你迄今给我的东西! - John – user1460275 2013-05-13 19:40:29

+0

@ user1460275在'rss.php'的末尾添加'?'。 – 2013-05-13 20:43:44

+0

非常感谢Jon!它非常完美! – user1460275 2013-05-14 03:20:27