Remove “public” word from the URL – Laravel Project

By Syed Murtaza

By default, Laravel project when accessed via the browser points to the public folder. It does not look good as it adds extra path to the url with “public”. So in order to access the website directly without the “public” keyword, do the following:

Steps are given below:-

  1. Copy .htaccess file from public folder
  2. Now paste it into your root.
  3. Now rename server.php file/page to index.php on your root folder.
  4. Now you can remove /public word from URL
  5. Refresh the page.

Now it will work.