Discuz X3.2 partition gid perfect pseudo static method Apache/nginx

Source: Internet
Author: User

Discuz official given the pseudo-static rules are not complete, only implemented partial pseudo-static settings and rules, partition GID is still the form of forum.php?gid=xxx, for obsessive-compulsive disorder I can not bear, the following gives the partition GID pseudo-static implementation method, including the Forum home page and section pages, List page, post reading page and Forum posting page (perfect for Discuz X2.5 or above, with default style as an example).

Demo URL: http://www.bbseat.com.cn/forum.php

Forum Home: Open template/default/forum/discuz.htm

Search:

forum.php?gid=$cat[FID]

To be replaced by:

forum-$cat[fid].html

Section page: open source/module/forum/forum_forumdisplay.php

Search:

location:forum.php?gid=$_g[FID]

To be replaced by:

location:forum-$_g[fid].html

Search:

Forum.php?gid= '. $forum _up[' FID ']. '

To be replaced by:

forum-'. $forum _up[' FID ']. Html

Search:

Forum.php?gid= '. $forum _top[' FID ']. '

To be replaced by:

forum-'. $forum _top[' FID ']. Html

posts page: open source/module/forum/forum_viewthread.php

Search:

? ' Forum.php?gid= '. $fup :

To be replaced by:

? ' forum-'. $fup. " HTML ':

There are two places to change.

Post page: open source/module/forum/forum_post.php

Search:

? ' Forum.php?gid= '. $fup :

To be replaced by:

? ' forum-'. $fup. " HTML ':

There are also two places to change.

Partition pseudo-Static rules

Nginx pseudo static rule:

rewrite ^ ([^\.] *)/forum-([0-9]+) \.html$ $1/forum.php?gid=$2 last;

Apache pseudo-Static rule:

Rewritecond%{query_string} ^ (. *^forum-(\w+) \.html$ forum.php?gid=$1 [L]

Discuz X3.2 partition gid perfect pseudo static method Apache/nginx

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.