htaccess..更改域名
我有一个大型 Joomla 网站,已从 .com 域移至 .eu 域。 这些站点位于一台 Web 服务器上。
在旧网站上有很多直接指向 oldwebsite.com/somethinghere 的链接。
有没有办法使用旧域文件夹中的 Htaccess 文件进行重定向 从 oldwebsite.com/somethinghere 到 newwebsite.eu/somethinghere?
或者也许有一种方法可以在新的网站文件夹上执行此操作?
谢谢你, 克里斯.
I have a big Joomla website that was moved from .com to .eu domain.
The sites are on one web server.
On the old website there are a lot of links that point directly to oldwebsite.com/somethinghere.
Is there a way with Htaccess file in the old domains folder to redirect
from oldwebsite.com/somethinhere to newwebsite.eu/somethinghere?
Or maybe a way to do this on the new website folder?
Thank you,
Chris.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有很多方法,有些人建议使用 RewriteEngine,但有一种更简单的方法:
这将自动处理域中的文件 - 例如,old.com/foo 将被重定向到 new.eu/foo
编辑: 关于“301”,这是永久重定向的代码。还存在临时重定向(我相信代码是 302),但听起来您需要的正是这个 - 永久重定向。
编辑2:哦,我认为domain.eu后面的/可能是必需的,但我不是100%确定-它在那里不会有什么坏处,这是肯定的!我知道这一点是因为我在生产网站上使用了相同类型的重定向。
There are many ways, some people recommend using RewriteEngine, but there is an easier way:
This will automatically handle files in the domain -- for example, old.com/foo will be redirected to new.eu/foo
EDIT: Regarding "301", that is the code for a permanent redirect. There also exist temporary redirects (I believe the code is 302), but it sounds like what you need is exactly this - a permanent redirect.
EDIT2: Oh and, I think the / after domain.eu may be required, but I'm not 100% sure - doesn't hurt for it to be there, that's for sure! I know that because I use the same kind of a redirect on a production website.