How to fix 301 redirect (URL Canonicalization) on your website using .htaccess file.

Поделиться
HTML-код
  • Опубликовано: 26 авг 2024
  • #ingenious #url_canonicalization #301_redirect #htaccess #http #https #www #server_redirection
    How to fix 301 redirect (URL Canonicalization) on your website using .htaccess file.
    abc.com and www.abc.com should resolve to the same URL
    Replace this code with your current .htaccess file.
    Remember to change your domain name.
    If you have SSL certificate (HTTPS) use complete code.
    I put that code on comment section.
    Thank you for watching !
    Please subscribe my channel
    Drop your comment, like and don't forget to share.
    Thank You!...

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

  • @ingenious2530
    @ingenious2530  4 года назад +1

    Replace this with your current .htaccess file.
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.abc\.com$
    RewriteRule ^/?$ "http\:\/\/abc\.com\/" [R=301,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    If you have SSL certificate (HTTPS) use complete code.
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.abc\.com$
    RewriteRule ^/?$ "http\:\/\/abc\.com\/" [R=301,L]
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ %{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

  • @Virtualcard-n8l
    @Virtualcard-n8l Год назад

    bro you solve a big issue ... thanks

  • @FixitFree
    @FixitFree 3 года назад +2

    not working

  • @venkateshchaluvadhi3891
    @venkateshchaluvadhi3891 10 месяцев назад

    I want to make in redhat linux what is the process and where is the path??? Pls reply

  • @mgaanacom3071
    @mgaanacom3071 3 года назад +1

    I want to remove www

  • @Kamran_Sadikhov
    @Kamran_Sadikhov 2 года назад

    how it will be for subdomain? And for HTML file

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

    I want to remove my 301 redirect from http to https and leave only my https, is this the code i can use ?

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

      Yes, This is the code

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

      @@ingenious2530 can you please tell me what is the code for a site that uses https ssl certificate and without www ?

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

      @@citizenkane4382 If you are using 301 redirection for your https domain,
      you can redirect followings to same domain.
      www.abc.com
      abc.com
      www.abc.com
      www.abc.com
      abc.com
      abc.com

  • @bizzwoofer
    @bizzwoofer 10 месяцев назад

    super gay music