2013-05-13 64 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