user

Eslam Zedan

28 Feb 2022

Laravel force redirect to https

Servers, Hosting

Hello,

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 //dev.to/skipperhoa/laravel-redirect-http-to-https-via-htaccess-5d39 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]
</IfModule>

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

Comments

No Comments to show

© 2024 Copyrights reserved for web-brackets.com