Redirect all request to public/ folder in laravel 5

There are two solutions:

1. Using .htaccess with mod_rewrite

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

2. You can add a index.php file containing the following code and put it under your root Laravel folder (public_html folder).

<?php
header('Location: public/');

Src: https://stackoverflow.com/questions/38040502/how-do-you-redirect-all-request-to-public-folder-in-laravel-5

Share

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.