Home > PHP Framework > Laravel > body text

How to remove index.php in laravel

藏色散人
Release: 2023-01-13 00:40:22
Original
3667 people have browsed it

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.

How to remove index.php in laravel

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template