How to Remove Public From URL in Laravel

How to Remove Public From URL in Laravel

Remove the public from URL in laravel. In this tutorial, we will learn how to remove the public from URL in laravel. ### Remove Public From URL Laravel There is two way to remove public from URL in laravel * * Create .htaccess file and update...

This is image title Originally Published at Tutsmake.com

Remove the public from URL in laravel. In this tutorial, we will learn how to remove the public from URL in laravel.

Remove Public From URL Laravel

There is two way to remove public from URL in laravel

  • Create .htaccess file and update content
  • Raname server.php and move .htaccess file

Create .htaccess file and update content

Now Create and update the .htaccess file in the Laravel. You can find .htaccess file in root directory.

You must have mod_rewrite enable on your Apache server. The rewrite module is required to apply these settings. You also have enabled .htaccess in Apache virtual host for Laravel.

Update the code into your .htaccess file:

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

Rename server.php and move .htaccess file

Here, you can follow the below steps for remove public from url in laravel

The first step is, Rename server.php in your Laravel root folder to index.php Copy the .htaccess file from /public directory to your Laravel root folder.

Conclusion

In this tutorial remove the public from URL in laravel. Here you have learned two ways to remove the public from URL in laravel.

Originally Published at Tutsmake.com

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Dynamically Add/Remove Multiple input Fields and Submit to DB with jQuery and Laravel

In this tutorial, we will sho you how to dynamically add/remove multiple input fields and submit to database with jquery and laravel

Php how to delete multiple rows through checkbox using ajax in laravel

In this article i will let you know to delete multiple rows through checkbox using ajax in laravel and before delete we will give a confirmation message.

Laravel - Dynamically Add or Remove Input Fields

laravel dynamically add or remove input fields using jquery. We'll show you how to dynamically add/remove input field in laravel using jQuery

How to Hire Laravel Developers and How Much Does It Cost.

Want to make the most out of the latest Laravel technology? Here is your guide on how to hire the best Laravel developer, and at the right price. 

How to perform migration rollback in laravel

Sometimes we need to rollback one specific migration. Here, in this article we will discuss about the migration rollback in laravel.