Rewrite Rules for discuz forum in nginx Environment
Source: Internet
Author: User
1. It should be noted that all the rewrites that have been circulating on the Internet are incorrect. In the following rewrite, the semicolon contains an extra Transfer Character "\", which is required in Apache, but not in nginx. Rewrite ^/thread-([0-9] +)-([0-9] +)-([0-9] +) \. html $/viewthread. php? Tid = $1 & extra = Page \ % 3d $3 & page = $2 last; correct should be rewrite ^/thread-([0-9] +) -([0-9] +)-([0-9] + )\. HTML $/viewthread. PHP? Tid = $1 & extra = Page % 3d $3 & page = $2 last; this error basically exists on all websites that use nginx as the server and have enabled rewrite. Including discuz! Official website. Complete and correct discuz! Rewrite in nginx is as follows: rewrite ^/archiver/(FID | tid)-[\ W \-] + \. html) $/archiver/index. php? $1 last; rewrite ^/Forum-([0-9] +)-([0-9] +) \. html $/Forumdisplay. php? FID = $1 & page = $2 last; rewrite ^/thread-([0-9] +)-([0-9] +) -([0-9] + )\. HTML $/viewthread. PHP? Tid = $1 & extra = Page % 3d $3 & page = $2 last; rewrite ^/space-(username | UID )-(. + )\. HTML $/space. PHP? $1 = $2 last; rewrite ^/Tag-(. +) \. html $/Tag. php? Name = $1 last;
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.