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

https://app.gitbook.com/@htaccess/s/htaccess/cau-hinh-thanh-cong-htaccess-chuyen-tu-http-toi-https-laravel-7-ok

C:\xampp\htdocs\bangtaivietnam\.htaccess remove folder public

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ /public/$1 [L]
</IfModule>

C:\xampp\htdocs\auth\.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.*)$ index.php/$1 [L]
  RewriteCond %{HTTPS} !=on   
	RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</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