how to remove public from url in laravel 8 1

how to remove public from url in laravel 8

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]

RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1 

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php

Here is what the above code is Doing:
1. If the requested file is a directory or a file, then don’t do anything.
2. If the requested file has an extension, then send it to the public folder.
3. If the requested file is not a directory or a file, then send it to the server.php file.

Similar Posts