user image

Eslam Zedan
Published in : 2022-02-28

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 onRewriteCond %{REQUEST_URI} !^publicRewriteRule ^(.*)$ 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

There is no comments yet

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

How to convert .pfx file to .crt file for Tomcat server?
Publish date: 2022-02-27 | Comments: 2

Servers, Hosting