htaccess..更改域名

发布于 2024-09-28 15:05:18 字数 271 浏览 3 评论 0原文

我有一个大型 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

往日情怀 2024-10-05 15:05:18

有很多方法,有些人建议使用 RewriteEngine,但有一种更简单的方法:

Redirect 301 / http://domain.eu/

这将自动处理域中的文件 - 例如,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:

Redirect 301 / http://domain.eu/

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文