2013-10-07 208 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/