Cấu hình thành công htaccess chuyển từ http tới https Laravel 7 (ok)

C:\xampp\htdocs\auth.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on   
		RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

C:\xampp\apache\conf\extra\httpd-vhosts.conf

 <VirtualHost auth.com:80>
     DocumentRoot "C:\xampp\htdocs\auth\public"
     ServerName auth.com
     ServerAlias www.auth.com
 </VirtualHost>
 <VirtualHost auth.com:443>
     DocumentRoot "C:\xampp\htdocs\auth\public"
     ServerName auth.com
     ServerAlias www.auth.com
     SSLEngine on
     SSLCertificateFile "conf/ssl.crt/server.crt"
     SSLCertificateKeyFile "conf/ssl.key/server.key"
 </VirtualHost>

Last updated