This article introduces how to configure discuz in the nginx environment! The x3 pseudo-static method shares the configuration content for your reference. This section describes how to configure discuz in Nginx! X3 pseudo-static. You can perform the following three steps: Step 1. in the nginx configuration file, add the following code example: rewrite ^ ([^ \.] *)/topic -(. + )\. html $1/
This article introducesNginxEnvironment, configureDiscuz! The x3 pseudo-static method shares the configuration content for your reference.
Content of this section:
Configure discuz in Nginx! X3 pseudo-static.
You can perform the following three steps:
Step 1. in the nginx 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:
Sample code:
# Service nginx restart