Discuz! Configure pseudo-static rules in X3

Source: Internet
Author: User
How to set Discuz! X3: pseudo-static configuration; the most practical tutorial on vps pseudo-static settings, discuzx3: pseudo-static iis server settings; URL-static is a configuration that facilitates search engines, through URL-static, when the original dynamic PHP page is converted to a static HTML page, it can improve search engine crawling. of course, here the static page is a way of Discuz! X3: Configure pseudo-static. the most practical tutorial on vps pseudo-static settings, DiscuzX3 pseudo static iis server settings; URL static settings are conducive to search engine settings, through URL static, achieve the original dynamic PHP page into static HTML page, it can improve search engine crawling. of course, static here is a kind of false static. The purpose is to increase the search volume of the search engine. The following describes the configuration methods.
In two cases, one is an independent host user, which has the permission to manage the host, so it is easier to configure it.

First, determine the Apache version you are using and whether the mod_Rewrite module is loaded.
For Apache 1.x users, check whether the following two sections of code exist in conf/httpd. conf:
LoadModule Rewrite_module libexec/mod_Rewrite.so
For users of AddModule mod_Rewrite.c Apache 2.x, check whether the following code exists in conf/httpd. conf:
LoadModule Rewrite_module modules/mod_Rewrite.so
If yes, add the following code to the configuration file (usually conf/httpd. conf. Note that if the website is defined by a virtual host, you must add it to the virtual host configuration, that is, in progress. if it is added to the virtual host configuration, it may not work, restart Apache after modification.

I. 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 ^ (. *)/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 ^ (. *)/(fid | tid)-([0-9] +) \. html $1/index. php? Action = $2 & value = $3 & % 1

If mod_Rewrite is not installed, you can recompile Apache, add -- enable-Rewrite = shared to the configure content, and then add the above code to the Apache configuration file.

II. Apache Web Server (virtual host user)

Before proceeding with the following settings, please first consult your space service provider, whether the space supports Rewrite and whether it supports the site directory. file parsing of htaccess, otherwise it cannot be used even if it is set according to the following method.
Check whether the. htaccess file exists in the directory where the forum is located. if not, create this file manually. In Win32 system, A. htaccess file cannot be created directly. you can copy a file from another system, edit and modify the. htaccess file, and add the following content:

# 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 ^ 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 \=$ 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 ^ archiver/(fid | tid)-([0-9] +) \. html $ archiver/index. php? Action = $1 & value = $2 & % 1

III. IIS Web Server (Independent host user)

Note: You need to add components for Rewrite under IIS by using filters. The following describes how to download and configure components:
IIS Rewrite download Discuz!X3Configure pseudo-static? The most practical tutorial on pseudo-static vps settingsIIS "/> Rewrite.zip(100.13 KB, Downloads: 34759)

Upload at, 2011-6-7

Click the file name to download the attachment.

IIS Rewrite configuration
1. decompress the downloaded IIS Rewrite component and place it to any directory on any disk (such as C: Rewrite)

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964499 "/>

2. in IIS Manager, right-click a website and choose Properties, as shown in:

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964500 "/>

In the displayed window, select "ISAPI filter"

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964501 "/>

Click "Add". in the displayed window, enter "rewrite" in "filter name"

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964502 "/>

Click browse on the page and select the Rewrite. dll file under the IIS Rewrite component directory after downloading and unzipping.

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964503 "/>

Click "OK" after browsing"

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964504 "/>

After adding, click "OK ".

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964505 "/>

Restart IIS

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964506 "/>
Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964507 "/>

Right-click the site and choose "attribute"> "ISAPI filter". if the green arrow is displayed, the Rewrite module is successfully installed.

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964508 "/>

Return to the forum homepage and open a forum or post to view Discuz! The Rewrite Pseudo-static configuration is successful!

Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964509 "/>
Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "title =" how is Discuz! X3 Configure pseudo-static? The most practical tutorial on pseudo-static vps settings IIS "id =" aimg_964498 "/>

IV. IIS7 Web Server (Independent host user)

You can add the following configuration rules to web. config.

V. Zeus Web Server

The configuration rules are as follows:

Match URL into $ with ^ (. *)/topic-(. +) \. html \? * (. *) $

If matched then

Set URL = $1/portal. php? Mod = topic & topic = $2 & $3

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 \ = $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 ^ (. *)/(fid | tid)-([0-9] +) \. html \? * (. *) $

If matched then

Set URL = $1/index. php? Action = $2 & value = $3 & $4

Endif

VI. Nginx Web Server

The configuration rules are as follows:

Rewrite ^ ([^ \.] *)/topic-(. +) \. html $1/portal. php? Mod = topic & topic = $2 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 ^ ([^ \.] *)/(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.