How to remove index.php from ecstore

藏色散人
Release: 2023-03-05 19:30:01
Original
2328 people have browsed it

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. .

How to remove index.php from ecstore

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]
Copy after login

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);
Copy after login

to

define('WITH_REWRITE', true);
Copy after login

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!

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