How to redirect HTTP to HTTPS and WWW to non-WWW in Laravel website via htaccess

Published: 17 December 2022
on channel: Aman Jaiswal
2,683
34

How to redirect HTTP to HTTPS and WWW to non-WWW in Laravel website via htaccess

forcing http:// to https://
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

www.domain.tld to domain.tld
RewriteCond %{HTTP_HOST} ^www.DOMAIN_NAME.TLD$ [NC]
RewriteRule ^(.*)$ https://DOMAIN_NAME.TLD/$1 [R=301,L]


Watch video How to redirect HTTP to HTTPS and WWW to non-WWW in Laravel website via htaccess online without registration, duration hours minute second in high quality. This video was added by user Aman Jaiswal 17 December 2022, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,68 once and liked it 3 people.