ecstore method to remove index.php: first enable the rewrite module of the apache server; then create a new [.htaccess] file in the root directory of the website; then modify the rewrite configuration in the project configuration file; and finally restart the server. .
Recommended: "PHP Video Tutorial"
How to remove Index.php from ECStore
I tried several methods online but none worked. I tinkered with it myself and found that when writing rewrite, RewriteBase was not added. /
The method is as follows:
Step 1- Enable the rewrite module of the apache server
1. Find the httpd.conf file in the apache server
2. Remove the # at the front of #LoadModule rewrite_module modules/mod_rewrite.so and enable this module
Step 2 - Create the .htaccess file in the root directory of the website
The content of the file is as follows:
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_FILENAME} -l RewriteRule . - [NC,L] RewriteRule . index.php [NC,L]
Note: The .htaccess file cannot be created directly under Windows, you can use a text editor Save after creation
Step 3 – Modify the rewrite configuration in the configuration file in this project
Find
config/compatible.php (or config/config.php) Around line 38 of this file (if you can’t find it, search for the string in the file: Rewrite),
change
define('WITH_REWRITE', false);
to
define('WITH_REWRITE', true);
Step 4 – Restart the server .
The above is the detailed content of How to remove index.php from ecstore. For more information, please follow other related articles on the PHP Chinese website!