After the server data transfer to the local server, the local open home page appeared layout disorder and other issues, after the great God pointed out that the URL rewrite problem.
This article mainly writes about how to open the URL rewrite function of Apache.
Open apache2\conf\httpd.conf
Search Loadmodulerewrite_module modules/mod_rewrite.so (Apache2 is this)
Get rid of the front #
Search Allowoverridenone replaced by Allowoverrideall
There are several that have found something similar to the following code.
</IfModule>
#
# "D:\usr\local\Apache2\cgi-bin" should is changed to whatever your scriptaliased
# CGI Directory exists, if you have thatconfigured.
#
<directory "D:\usr\local\Apache2\cgi-bin" >
AllowOverride All
Options None
Order Allow,deny
Allow from all
</Directory>
Two add in apache2\conf\httpd.conf last line
<ifmodule mod_rewrite.c>
Rewriteengine on
Rewriterule ^ (. *)-htm-(. *) $ $1.php?$2
</IfModule>
If you do not add the above content in the apache2\conf\httpd.conf file, you can create a. htaccess file in the site directory after you write to the file
Rewriteengineon
Rewriterule ^ (. *)-htm-(. *) $ $1.php?$2
The Apache module is now open for completion. Visit the local home page again for success.
For a detailed URL rewrite configuration please see my related article.
Apache Open URL Rewrite module