How to remove public from url in laravel – onlinecode
In this post we will give you information about How to remove public from url in laravel – onlinecode. Hear we will give you detail about How to remove public from url in laravel – onlinecodeAnd how to use it also give you demo for it if it is necessary.
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.
<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.*)$ public/$1 [L] </IfModule>
Hope this code and post will helped you for implement How to remove public from url in laravel – onlinecode. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs