website-analysis

Blog

Laravel Redirect HTTP to HTTPS via .htaccess

Laravel Redirect HTTP to HTTPS via .htaccess

Today, i am going to share with you, how to redirect http to Https in laravel You create file .htaccess in root laravel
<IfModule mod_rewrite.c>
    RewriteEngine On
    # Force SSL
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
    # Remove public folder form URL
    RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
READY TO DO THIS

Let's get to work

Contact Us
Need Help? Chat with us