First, determine the apache version you are using and whether the mod_rewrite module is loaded.
For Apache 1.x users, check whether the following two sections exist in CONF/httpd. conf:Code:
Loadmodule rewrite_module libexec/mod_rewrite.so addmodule mod_rewrite.c
For Apache 2.x users, check whether the following code exists in CONF/httpd. conf: loadmodule rewrite_module modules/mod_rewrite.so
If yes, add the following code to the configuration file (httpd. conf. Note that if the website is defined by a virtual host, you must add it to the virtual host configuration, that is, in progress. If you add it to the virtual host configuration, it may not be available. After modification, restart Apache.
After the mod_rewrite module is enabled, you can also create. to rewrite the URL, you must first enable AllowOverride all in the site directory (AllowOverride none by default );
. the content of the htaccess file is as follows # enable rewriteengine on in rewriteengine mode # Modify/DIR in the following statement to your site directory address, if the Program is placed in the root directory, change/DIR to/rewritebase/DIR # rewrite to modify the corresponding system rule
rewriterule ^ archiver/(FID | tid)-[\ W \-] + \. html) $ archiver/index. PHP? $1
rewriterule ^ Forum-([0-9] +)-([0-9] +) \. html $ Forumdisplay. php? FID = $1 & page = $2
rewriterule ^ thread-([0-9] +)-([0-9] +) -([0-9] + )\. HTML $ viewthread. PHP? Tid = $1 & extra = Page \ % 3d $3 & page = $2
rewriterule ^ space-(username | UID )-(. + )\. HTML $ space. PHP? $1 = $2 rewriterule ^ tag-(. +) \. html $ tag. php? Name = $1 place the created. htaccess file in the corresponding directory. In this case, the URL static address can be supported for search engine crawling.