Apache, IIS Discuz x1.5 pseudo-static setting method

Source: Internet
Author: User

1. For an Apache server, perform the following operations:

Create a. htaccess file and write the following pseudo-static rules into the file:Copy codeThe Code is as follows: # enable RewriteEngine Mode
RewriteEngine On

# Modify/discuz in the following statement to your forum directory address. If your program is in the root directory, change/discuz/
RewriteBase/discuzxx

# Do not modify Rewrite system rules
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ topic-(. +) \. html $ portal. php? Mod = topic & topic = $1 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ article-([0-9] +)-([0-9] +) \. html $ portal. php? Mod = view & aid = $1 & page = $2 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ forum-(\ w +)-([0-9] +) \. html $ forum. php? Mod = forumdisplay & fid = $1 & page = $2 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ thread-([0-9] +)-([0-9] +)-([0-9] +) \. html $ forum. php? Mod = viewthread & tid = $1 & extra = page \ % 3D $3 & page = $2 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ group-([0-9] +)-([0-9] +) \. html $ forum. php? Mod = group & fid = $1 & page = $2 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ space-(username | uid)-(. +) \. html $ home. php? Mod = space & $1 = $2 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ ([a-z] +)-(. +) \. html $ 1.php? Rewrite = $2 & % 1

2. For IIS6, perform the following operations:

Download the Discuzx 1.5 Rewrite component, upload it to the root directory of the server, and load Rewrite. dll from the uploaded Rewrite component in "ISAPI.
Or a friend who has installed rewrite
Httpd. iniCopy codeThe Code is as follows: [ISAPI_Rewrite]

#3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32

# Protect httpd. ini and httpd. parse. errors files
# From accessing through HTTP
RewriteRule ^ (. *)/topic-(. +) \. html (\? (. *) * $1/portal \. php \? Mod = topic & topic = $2 & $4
RewriteRule ^ (. *)/article-([0-9] +)-([0-9] +) \. html (\? (. *) * $1/portal \. php \? Mod = view & aid = $2 & page = $3 & $5
RewriteRule ^ (. *)/forum-(\ w +)-([0-9] +) \. html (\? (. *) * $1/forum \. php \? Mod = forumdisplay & fid = $2 & page = $3 & $5
RewriteRule ^ (. *)/thread-([0-9] +)-([0-9] +)-([0-9] + )\. html (\? (. *) * $1/forum \. php \? Mod = viewthread & tid = $2 & extra = page \ % 3D $4 & page = $3 & $6
RewriteRule ^ (. *)/group-([0-9] +)-([0-9] +) \. html (\? (. *) * $1/forum \. php \? Mod = group & fid = $2 & page = $3 & $5
RewriteRule ^ (. *)/space-(username | uid)-(. +) \. html (\? (. *) * $1/home \. php \? Mod = space & $2 = $3 & $5
RewriteRule ^ (. *)/([a-z] +)-(. +) \. html (\? (. *) * $1/$2 \. php \? Rewrite = $3 & $5

If it is an IIS virtual host, repair the corresponding httpd. ini file.

Then, enable the pseudo static page in "Global" = "" optimization Settings "=" Search Engine Optimization.

I have succeeded in pseudo-static configuration in Apache and IIS environments.

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.