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.

Комментарии • 32

  • @DamonMedekMusic
    @DamonMedekMusic 3 года назад +3

    Thanks for putting the code in the description. Real hero.

  • @DamonMedekMusic
    @DamonMedekMusic 3 года назад

    Thanks for putting the code in the comments. Real hero.

  • @DarrelDressel75
    @DarrelDressel75 8 месяцев назад

    The was hugely helpful. Thanks for sharing.

    • @RyanHuang
      @RyanHuang  8 месяцев назад

      You're welcome!

  • @quentin-tarant
    @quentin-tarant 3 года назад

    Thank you so much I was struggling so much to do this !!

  • @MarkCayab
    @MarkCayab 3 года назад

    You save me today :) 2021 here hehe

  • @rohitjangirofficial
    @rohitjangirofficial 5 лет назад

    Very Useful Video 👌

  • @nesrineAmamou
    @nesrineAmamou 3 года назад

    thanks, this worked for me =)

  • @loveutubeize
    @loveutubeize 8 лет назад +2

    where should i put the .htaccess file? in the same directory with the "index.html" ?

  • @daviduno1678
    @daviduno1678 7 лет назад +2

    I have followed each step religiously and it is still not redirecting.

  • @DougMotelMarketing
    @DougMotelMarketing 9 лет назад +3

    No code found.

  • @mannypruggy672
    @mannypruggy672 Год назад

    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!

  • @Getfoundmadison
    @Getfoundmadison 7 лет назад

    What if the other URLs changed on the new site, like the blog posts no longer include dates?

  • @JWolfshaim
    @JWolfshaim 9 лет назад +1

    How can i only redirect mobile users?

  • @kenankaraca2415
    @kenankaraca2415 7 лет назад

    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....

  • @hdchutties
    @hdchutties 3 года назад

    Is it possible to block the domain redirecting to my site?

    • @cpg7804
      @cpg7804 3 года назад

      good question

  • @mikee.
    @mikee. 7 лет назад

    Can I redirect to a certain directory using this method?

  • @kennyL3010
    @kennyL3010 9 лет назад

    Where is the link?

    • @JakobHaq
      @JakobHaq 9 лет назад

      It's here: yanshenghuang.com/video/how-to-301-redirect-a-domain-name-to-another-using-htaccess/

    • @JakobHaq
      @JakobHaq 9 лет назад

      But I can't find anything to copy/paste... :(

    • @kennyL3010
      @kennyL3010 9 лет назад

      Jakob Haq thanks!

    • @JakobHaq
      @JakobHaq 9 лет назад

      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. :(

  • @rembrandt702
    @rembrandt702 5 лет назад

    What is [NC, OR]?

    • @jahanzaibalam6389
      @jahanzaibalam6389 5 лет назад

      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)