Eslam Zedan

28 Feb 2022

Laravel force redirect to https

Servers, Hosting


I am trying to force redirect https + remove public folder from url so I was using this .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

Then as I found this in // I change my file  to 


<IfModule mod_rewrite.c>
 RewriteEngine On 
 RewriteCond %{HTTPS} !=on 
 RewriteRule ^ //%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 RewriteRule ^(.*)$ public/ [L]

but all asset files do not load properly  they need to add public in their URL to load fine

I am on GoDaddy shared host


No Comments to show

© 2023 Copyrights reserved for