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.
- First step is rename your server.php file to index.php in root directory.
- Second step copy your .htaccess file from public folder and paste in root directory.
Now run your your project without public directory in url.
Read Also : Laravel One to One Relationship.