Why we rename server.php to index.php file

laravel renamed server PHP to index PHP. Here we discuss why we rename the server.php file to the index.php file. Remove public directory from URL in laravel 7, laravel 8, laravel 9. Laravel .htaccess for removing the public from URL. Laravel shows the public directory in my all URLs.


Laravel remove public from url

When you run directly your laravel project it show public directry in your all urls. you can remove public by following steps. By this you can run project without starting server.

  1. First step is rename your server.php file to index.php in root directory.
  2. Second step copy your .htaccess file from public folder and paste in root directory.

Now run your your project without public directory in url.

php laravel developer anmol sharma

Anmol Sharma

I am a software engineer and have experience in web development technologies like php, Laravel, Codeigniter, javascript, jquery, bootstrap and I like to share my deep knowledge by these blogs.

Random tutorial links