Laravel Remove Public From URL Steps

Today, We want to share with you Laravel Remove Public From URL Steps.In this post we will show you Remove “public” in URL in Laravel 5.7 Step By Step, hear for Laravel 5.7 – Remove Public from URL using htaccess we will give you demo and example for implement.In this post, we will learn about How to Remove Public Directory in Laravel 5.5, 5.6, 5.7 with an example.

Laravel Remove Public From URL Steps

There are the Following The simple About Laravel Remove Public From URL Steps Full Information With Example and source code.

Read Also:  Laravel GroupBy Error Solution 5.5 , 5.6, 5.7

As I will cover this Post with live Working example to develop how to remove public from url in laravel on server,, so the some laravel 5.7 remove public from url for this example is following below.

Step 1: Rename File

Laravel’s .htaccess to remove “public” from URL

simple change your server.php file in the root file to index.php

//in your Laravel root folder to 

Step 2: Update .htaccess

Simple Your .htaccess file and put it laravel Main root folder

Read Also:  Laravel 5.6 PDF Generation using Dompdf Example

Options -MultiViews -Indexes

RewriteEngine On

# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Handle Front Laravel Controller...
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public/$1/$2 [L,NC]

Laravel 5.* Project- Remove public from URL

Move Laravel Project From localhost to live production server : More Easy MethodsRemoving PUBLIC from URL in Laravel

Read Also:  Laravel 6 Required With All Validation Example

require __DIR__.'/../bootstrap/autoload.php';
require __DIR__.'/../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../bootstrap/app.php';
$app = require_once __DIR__.'/../laravel/bootstrap/app.php';

Note : And Last You remove all cache and cookies.

Angular 6 CRUD Operations Application Tutorials

Read :


You can also read about AngularJS, ASP.NET, VueJs, PHP.

I hope you get an idea about Laravel Remove Public From URL Steps.
I would like to have feedback on my blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Related FAQ

Here are some more FAQ related to this Article:

  1. Read Also:  Bootstrap Datetimepicker Disable Dates Dynamically
  2. Read Also:  Dynamically set active tab in jquery
  3. Read Also:  VueJS Filter Currency Rounding 2 decimal places Example
  4. Read Also:  Laravel 5 – Remove Public from URL
  5. Read Also:  Laravel 6 Remove public from URL
  6. Read Also:  Check if row exists using Laravel
  7. Read Also:  Bootstrap Forms group - Examples & Tutorials
  8. Read Also:  cannot be loaded because running scripts is disabled on this system
  9. Read Also:  Laravel Send Emails Mailgun setup Tutorial
  10. Read Also:  REST API Insert Update Delete using PHP