I want to remove public from my web URL simply step by step
I have done some steps already like copying the file from public the index and htaccess file but still I am getting not found page
I tried to solve this problem simply by making a .htaccess file. This file configures the apache server and solves the problem. Simply put this code in a file named '.htaccess' and save it in the root folder.
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> 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 </IfModule> It's possible to remove public from url in laravel5. Follow these steps:
step 1 : copy all file from public and paste on root directory
step 2 : open index.php file replace with
require __DIR__.'/../bootstrap/autoload.php'; to
require __DIR__.'/bootstrap/autoload.php'; and
$app = require_once __DIR__.'/../bootstrap/app.php'; to
app = require_once __DIR__.'/bootstrap/app.php'; Then Remove all cache and cookies.
php artisan cache:clear