Laravel 5 – Remove Public from URL

Today, We want to share with you Laravel 5 – Remove Public from URL.In this post we will show you laravel 5.6 remove index.php from url, hear for Laravel’s .htaccess to remove “public” from URL (Example) we will give you demo and example for implement.In this post, we will learn about Laravel – Remove Public from URL using htaccess with an example.

Laravel 5 – Remove Public from URL

There are the Following The simple About Laravel 5 – Remove Public from URL Full Information With Example and source code.

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

Step 1: You need to simple Rename server.php in your Laravel root folder to index.php

Step 2: and then Copy the simple .htaccess file from /public directory to your main Laravel root folder.

Onther Way Just create simple .htaccess file at root and insert these lines to it


    RewriteEngine On

    RewriteRule ^(.*)$ public/$1 [L]

Laravel – Remove Public from URL using htaccess

Edit the .htaccess file so that it contains the following code:


   RewriteEngine On 
   RewriteRule ^(.*)$ public/$1 [L]

Web Programming Tutorials Example with Demo

Read :

Summary

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

I hope you get an idea about Laravel 5 – Remove Public from URL.
I would like to have feedback on my infinityknow.com 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.

Leave a Comment