How to remove public from url in laravel
Today, we will explain you how to remove public from url in laravel. when run application that time we face that problem. but today, we will share some solution of laravel how to remove public from url and remove public directory in laravel.
There are two ways remove public from url in laravel. (1) Rename File and move htaccess file (2)create htaccess File.
(1) Rename File and move htaccess file
First find the “server.php” file in root your project directory. that file rename to “index.php” and second Copy the “.htaccess” file in public directory and paste on root your project directory.
(2) Create htaccess File
Create the .htaccess file on root directory and paste below following code in this file. if do not work then enable the mod_rewrite module on apache server.
RewriteRule ^(.*)$ public/$1 [L]