Generate a static page URL address using Apache's REWRITE function

xiaoxiao2021-03-06  75

Studying Rewrite has been a period of time, and today I finally have the opportunity to send it. I use REWRITE to change the post to the static page URL address, which will greatly increase the opportunity of each article in our forum.

To use the REWRITE, you must have apache to install mod_rewrite, you can see if there is installation through the apachectl -l command, which is not installed by default. If not installed, just reinstall Apache, plus the --Nable-Rewrite selection when configure.

Modify the apache's httpd.conf file, increase the following two lines:

ReWriteEngine on

ReWriterule ^ / (/ d ) /. Html $ /index.php?module=article&tipleid=1

After restarting apache, just enter http://xxx.xxx.xxx/12345.html in the tour, you can automatically locate http://xxx.xxx.xxx/index.php?module=article&titleid=12345, but users Or only 12345.html's URL, such modification has no help to program speed, etc., but you can deceive search engines ~ It is very simple, everyone is interested ourselves and try it!

转载请注明原文地址:https://www.9cbs.com/read-93779.html

New Post(0)