Linux apache pseudo-static

Source: Internet
Author: User

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.