开发者

Htaccess.. changing the domain name

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 poi开发者_Go百科nt 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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜