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!...
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]
bro you solve a big issue ... thanks
not working
I want to make in redhat linux what is the process and where is the path??? Pls reply
I want to remove www
how it will be for subdomain? And for HTML file
I want to remove my 301 redirect from http to https and leave only my https, is this the code i can use ?
Yes, This is the code
@@ingenious2530 can you please tell me what is the code for a site that uses https ssl certificate and without www ?
@@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
super gay music