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.

Free Live Chat for Any Issue

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.

Also Read This 👉   Get Unique Collection values(Remove Duplicates from Collection) using Laravel

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

<IfModule mod_rewrite.c>
    RewriteEngine On

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

Laravel – Remove Public from URL using htaccess

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

Also Read This 👉   Angular 9/8 Material Textarea Examples

<IfModule mod_rewrite.c>
   RewriteEngine On 
   RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

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.

Rate this post