Step 1: Find the Apache configuration file httpd. conf (the file is in the conf directory)
Step 2: First, you must allow the server to support mod_rewrite. If you are using a virtual host, ask your host provider in advance.
Open httpd. conf and find
# Loadmodule rewrite_module modules/mod_rewrite.so
Remove #
Change AllowOverride none to AllowOverride all,
NOTE: If AllowOverride is set to all, URL rule rewriting is supported on the entire server. The Apache server needs to read the. htaccess file under the directory of each website. Without this file, or the document does not define any URL rewriting rules, it will not have any effect.
For different URLs, add the following content to Apache:
<Directory "E:/Apache Group/apache2/htdocs/leapsoul">
/* The quotation marks indicate your web storage directory */
/* For Linux, you can locate your website directory */
Options followsymlinks
AllowOverride none
</Directory>
Step 3: restart the Apache server and press stop before start.
Step 4: place a. htaccess file in the website directory where you need to rewrite the URL. The file name is. htaccess, and cannot be directly created under windiws. You can save it as Notepad.