Home >PHP Framework >Laravel >How to remove index.php in laravel
How to remove index.php in laravel: 1. Rename the server.php file in the root directory of the laravel framework to index.php; 2. Copy the ".htaccess" file to the root directory of the framework; 3. , just modify Apache’s httpd.conf file.
The operating environment of this article: windows7 system, Laravel version 5.7, DELL G3 computer
The laravel framework implements the removal of the index in the URL. PHP method
1. Rename the server.php file in the framework root directory to index.php
2. Rename the public folder in the framework root directory. htaccess file is copied to the root directory of the framework and is in the same directory as index.php
3. Modify Apache’s httpd.conf file
1. The path where the httpd.conf file is located\bin\apache\ apache2.4.23\conf\httpd.conf, for example, the path to httpd.conf in my computer is: D:\wamp\bin\apache\apache2.4.23\conf\httpd.conf
Find httpd.conf After file, let’s modify it!
2. Around line 154, find the #LoadModule rewrite_module modules/mod_rewrite.so code and remove the
# in front of the code 3. Restart the Apache service
Is that right now? You can now access web projects without entering the annoying index.php in the URL!
Recommended tutorial: "laravel"
The above is the detailed content of How to remove index.php in laravel. For more information, please follow other related articles on the PHP Chinese website!