Linux apache pseudo-static
1. Open the configuration file httpd. conf of apache.
2. Remove the # loadmodule rewrite_module modules/mod_rewrite before #.
3. Add the following in httpd. conf:
<Ifmodule mod_rewrite.c>
Rewriteengine on
# Rewritecond % {env: script_url }(? : Index | dispbbs00000000-0-900000000.html
Rewriterule ^ (.*? (? : Index | dispbbs00000000-(-0-942500000000.html $1. php tutorial? _ Is_apache_rewrite = 1 & __ rewrite_arg = $2
</Ifmodule>
4. To map asp post URLs to php posts, add the following between <ifmodule mod_rewrite.c> and </ifmodule> in step 3:
Rewritemap tolowercase int: tolower
Rewritecond % {query_string }(? : Boardid | page | id | replyid | star | skin) = d + [nc]
Rewriterule ^ (.*(? : Index | dispbbs). asp $ 1.php? $ {Tolowercase: % {query_string }}&__ is_apache_rewrite = 1
5. Save httpd. conf and restart apache.
Next let's take a look at the method of writing the. htaccess file. This is the practice of the dz forum.
# Enable rewriteengine Mode
Rewriteengine on
# Modify/bbs in the following statement to your forum directory address. If the program is placed in the root directory, change/bbs/
Rewritebase/bbs
# Do not modify rewrite system rules
Rewriterule ^ archiver/(fid | tid0000-0000w-00000000.html) $ archiver/index. php? $1
Rewriterule used forum-(%0-9%%%%%-(%0-9%%%%%%.html $ forumdisplay. php? Fid = $1 & page = $2
Rewriterule implements thread-(%0-9%%%%%-(%0-9%%%%%%%%%%%%.html $ viewthread. php? Tid = $1 & extra = page % 3d $3 & page = $2
Rewriterule ^ space-(username | uid316-(.20.0000.html $ space. php? $1 = $2
Rewriterule implements tag-(.20.20..html $ tag. php? Name = $1
1. modify the configuration file httpd. conf of apache. Remove the # loadmodule rewrite_module modules/mod_rewrite before #.
2. Add the following in httpd. conf:
<Ifmodule mod_rewrite.c>
Rewriteengine on
#...
</Ifmodule>