2013-10-07 110 views
0

我已經提供了從我的網站在我andoird應用的鏈接是:如何將我網站中的鏈接重定向到外部鏈接?

www.mysite.com/support

,我想這個鏈接被重定向到:

www.anothersite.com

我已經嘗試com_redirect,進入support作爲源和http://ww.anothersite.com但我沒有得到任何重定向,我得到404錯誤。

我正在運行Joomla 3.x,我想知道如何使用URL重寫和無外部組件來做到這一點。

+0

我相信你必須輸入完整的url('http:// www.mysite.com/support')而不只是'support'來使它匹配。 –

+0

我得到tho下面的錯誤,當我這樣做時說:保存失敗,出現以下錯誤:源URL必須是唯一的。問題是與外部鏈接。內部鏈接工作正常與'com_redirect' –

+0

該錯誤應該只是意味着「http:// www.mysite.com/support」已經在系統中。如果您訪問過網址,可能已經有了一條記錄,但您必須確保它已發佈才能重定向它。 –

回答

2

在Joomla後端似乎不可能做到這一點(我嘗試了很多菜單項和重定向模塊的組合)。 爲了確保您可以直接在你的.htaccess寫您的重定向(如果您正在使用它)是這樣的:

RewriteEngine On # Turn on the rewriting engine 
RewriteRule ^support/?$ http://www.anothersite.com/ [R=301,NC,L] # Permanent Move 

RewriteEngine On # Turn on the rewriting engine 
RewriteRule ^support/?$ http://www.anothersite.com [R,NC,L] # Temporary Move 

更多關於URL重寫和的.htaccess信息在這裏:http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/