Hello,
In my project, It works only when I use HTTP but when I use HTTPS it redirect me to http://mydomain/public/public
Note: I didn`t change anything inside the public folder with original .htaccess as below:
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301] # Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] # Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule> And I only add the below .htaccess to the root folder to redirect all requests to public folder:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
In my project, It works only when I use HTTP but when I use HTTPS it redirect me to http://mydomain/public/public
Note: I didn`t change anything inside the public folder with original .htaccess as below:
Â<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301] # Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] # Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule> And I only add the below .htaccess to the root folder to redirect all requests to public folder:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
1 Answers
Hello,
You need to check your web server configuration, laraship, and Laravel works with HTTPS with no single change, and all URLs we have are relative
if you want to enforce HTTPS you can check the link below
https://stackoverflow.com/questions/35827062/how-to-force-laravel-project-to-use-https-for-all-routes/51819095
Please login or Register to submit your answer