Discuzx3 multiple server pseudo-static rules

Source: Internet
Author: User
In fact, it is obtained from the discuz backend and directly uses pseudo-static rules. you can choose based on the version used by your server. if it is a virtual host, you need to consult the server provider. ApacheWebServer (Independent host user) IfModulemod_rewrite.cRewriteEngineOnRewriteCond % {QUERY_STRING} ^ (. *) $ Rewri

It is actually fromDiscuzIf you win the rules in the backend, you can select a version based on your server. if you are a VM, you need to consult the server provider.

Apache Web Server (Independent host user)



RewriteEngine On
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ (. *)/topic-(. +) \. html $1/portal. php? Mod = topic & topic = $2 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ (. *)/article-([0-9] +)-([0-9] +) \. html $1/portal. php? Mod = view & aid = $2 & page = $3 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ (. *)/forum-(\ w +)-([0-9] +) \. html $1/forum. php? Mod = forumdisplay & fid = $2 & page = $3 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ (. *)/thread-([0-9] +)-([0-9] +)-([0-9] + )\. html $1/forum. php? Mod = viewthread & tid = $2 & extra = page \ % 3D $4 & page = $3 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ (. *)/group-([0-9] +)-([0-9] +) \. html $1/forum. php? Mod = group & fid = $2 & page = $3 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ (. *)/space-(username | uid)-(. +) \. html $1/home. php? Mod = space & $2 = $3 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ (. *)/blog-([0-9] +)-([0-9] +) \. html $1/home. php? Mod = space & uid = $2 & do = blog & id = $3 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ (. *)/(fid | tid)-([0-9] +) \. html $1/index. php? Action = $2 & value = $3 & % 1


Apache Web Server (virtual host user)


# 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/discuz
# 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 ^ blog-([0-9] +)-([0-9] +) \. html $ home. php? Mod = space & uid = $1 & do = blog & id = $2 & % 1
RewriteCond % {QUERY_STRING} ^ (. *) $
RewriteRule ^ archiver/(fid | tid)-([0-9] +) \. html $ archiver/index. php? Action = $1 & value = $2 & % 1


IIS Web Server (Independent host user)


[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 ^ (. *)/blog-([0-9] +)-([0-9] +) \. html (\? (. *) * $1/home \. php \? Mod = space & uid = $2 & do = blog & id = $3 & $5
RewriteRule ^ (. *)/(fid | tid)-([0-9] +) \. html (\? (. *) * $1/index \. php \? Action = $2 & value = $3 & $5


IIS7 Web Server (Independent host user)






































Zeus Web Server


Match URL into $ with ^ (. *)/topic-(. +) \. html \? * (. *) $
If matched then
Set URL = $1/portal. php? Mod = topic & topic = $2 & $3
Endif
Match URL into $ with ^ (. *)/article-([0-9] +)-([0-9] +) \. html \? * (. *) $
If matched then
Set URL = $1/portal. php? Mod = view & aid = $2 & page = $3 & $4
Endif
Match URL into $ with ^ (. *)/forum-(\ w +)-([0-9] +) \. html \? * (. *) $
If matched then
Set URL = $1/forum. php? Mod = forumdisplay & fid = $2 & page = $3 & $4
Endif
Match URL into $ with ^ (. *)/thread-([0-9] +)-([0-9] +)-([0-9] + )\. html \? * (. *) $
If matched then
Set URL = $1/forum. php? Mod = viewthread & tid = $2 & extra = page \ % 3D $4 & page = $3 & $5
Endif
Match URL into $ with ^ (. *)/group-([0-9] +)-([0-9] +) \. html \? * (. *) $
If matched then
Set URL = $1/forum. php? Mod = group & fid = $2 & page = $3 & $4
Endif
Match URL into $ with ^ (. *)/space-(username | uid)-(. +) \. html \? * (. *) $
If matched then
Set URL = $1/home. php? Mod = space & $2 = $3 & $4
Endif
Match URL into $ with ^ (. *)/blog-([0-9] +)-([0-9] +) \. html \? * (. *) $
If matched then
Set URL = $1/home. php? Mod = space & uid = $2 & do = blog & id = $3 & $4
Endif
Match URL into $ with ^ (. *)/(fid | tid)-([0-9] +) \. html \? * (. *) $
If matched then
Set URL = $1/index. php? Action = $2 & value = $3 & $4
Endif


Nginx Web Server


Rewrite ^ ([^ \.] *)/topic-(. +) \. html $1/portal. php? Mod = topic & topic = $2 last;
Rewrite ^ ([^ \.] *)/article-([0-9] +)-([0-9] + )\. html $1/portal. php? Mod = view & aid = $2 & page = $3 last;
Rewrite ^ ([^ \.] *)/forum-(\ w +)-([0-9] +) \. html $1/forum. php? Mod = forumdisplay & fid = $2 & page = $3 last;
Rewrite ^ ([^ \.] *)/thread-([0-9] +)-([0-9] +)-([0-9] + )\. html $1/forum. php? Mod = viewthread & tid = $2 & extra = page % 3D $4 & page = $3 last;
Rewrite ^ ([^ \.] *)/group-([0-9] +)-([0-9] + )\. html $1/forum. php? Mod = group & fid = $2 & page = $3 last;
Rewrite ^ ([^ \.] *)/space-(username | uid)-(. +) \. html $1/home. php? Mod = space & $2 = $3 last;
Rewrite ^ ([^ \.] *)/blog-([0-9] +)-([0-9] + )\. html $1/home. php? Mod = space & uid = $2 & do = blog & id = $3 last;
Rewrite ^ ([^ \.] *)/(fid | tid)-([0-9] +) \. html $1/index. php? Action = $2 & value = $3 last;
If (! -E $ request_filename ){
Return 404;
}


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.