How to 301 Redirect a Domain Name to Another Using .htaccess
HTML-код
- Опубликовано: 26 авг 2024
- Yan Sheng Huang explains how to do a 301 redirect from one domain name to another using the .htaccess file. This is the preferred method to maintain existing SEO or search engine optimization. This works on Linux servers which is what the majority of web hosts run on.
Thanks for putting the code in the description. Real hero.
Thanks for putting the code in the comments. Real hero.
The was hugely helpful. Thanks for sharing.
You're welcome!
Thank you so much I was struggling so much to do this !!
You save me today :) 2021 here hehe
Very Useful Video 👌
thanks, this worked for me =)
where should i put the .htaccess file? in the same directory with the "index.html" ?
I have followed each step religiously and it is still not redirecting.
No code found.
great video! but how can I add exception links? i need a few of my old pages to be working normally and landing on the old website. Please, help me with code, I'd be very grateful! Happy holidays!
What if the other URLs changed on the new site, like the blog posts no longer include dates?
How can i only redirect mobile users?
hi, i have changed my pages' url with yoast seo. but i forget to save old urls. then my ranking is suddenly decreased. pls help to 301 redirect my old urls to new....
Is it possible to block the domain redirecting to my site?
good question
Can I redirect to a certain directory using this method?
you can
Where is the link?
It's here: yanshenghuang.com/video/how-to-301-redirect-a-domain-name-to-another-using-htaccess/
But I can't find anything to copy/paste... :(
Jakob Haq thanks!
kennyL3010 No problem.
This stuff ain't easy... I've been sitting studying how to redirect my blog to a completely new site for 13 hours straight. I am no good with code at all. I got two blogs on the same domain, and I want to redirect one of the blogs to a completely new domain. Nothing works. :(
What is [NC, OR]?
The [NC] specifies that the http host is case insensitive. The escapes the "." - because this is a special character (normally, the dot (.) means that one character is unspecified)