Nginx configuration Discuz! X3 Forum URLRewrite pseudo-static rules

Source: Internet
Author: User
Configure discuz in Nginx! X3 pseudo-static, which can be implemented in the following three steps: Step 1. in the nginx configuration file, add: Sample Code: rewrite ^ ([^ \.] *)/topic -(. + )\. html $1/portal. php? Modtopictopic $2 last; rewrite ^ ([^ \.] *)/article -([

Nginx configurationDiscuz! X3 pseudo-static, which can be implemented in the following three steps. you can test it in person:

Step 1, inNginxIn the configuration file, add:

Sample code:

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;
Rewrite ^ ([^ \.] *)/([a-z] + [a-z0-9 _] *)-([a-z0-9 _ \-] + )\. html $1/plugin. php? Id = $2: $3 last;
If (! -E $ request_filename ){
Return 404;
}

Step 2. log on to discuz! Go to the SEO settings page and select the check box in static URL.
Step 3. restart nginx to make the pseudo-static configuration take effect:

Service nginx restart

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.