Static discuz URL

Source: Internet
Author: User

Static discuz URL, static discuz, static discuz forum settings, and discuz static settings. Here we will list static methods one by one.

I. Apache Web Server (Independent host user)

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
AddModule mod_rewrite.c
For Apache 2.x users, 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, add it to the virtual host configuration, that is<VirtualHost>. Restart Apache after modification.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^ (. *)/archiver/(fid | tid)-[\ w \-] + \. html) $1/archiver/index. php? $2
RewriteRule ^ (. *)/forum-([0-9] +)-([0-9] +) \. html $1/forumdisplay. php? Fid = $2 & page = $3
RewriteRule ^ (. *)/thread-([0-9] +)-([0-9] +)-([0-9] + )\. html $1/viewthread. php? Tid = $2 & extra = page \ % 3D $4 & page = $3
RewriteRule ^ (. *)/space-(username | uid)-(. +) \. html $1/space. php? $2 = $3
RewriteRule ^ (. *)/tag-(. +) \. html $1/tag. php? Name = $2
</IfModule>

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. A. htaccess file cannot be directly created in Win32. You can copy the file from another system or download the file in the Discuz.net technical support topic. 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
RewriteRule ^ archiver/(fid | tid)-[\ w \-] + \. html) $ archiver/index. php? $1
RewriteRule ^ forum-([0-9] +)-([0-9] +) \. html $ forumdisplay. php? Fid = $1 & page = $2
RewriteRule ^ thread-([0-9] +)-([0-9] +)-([0-9] +) \. html $ viewthread. php? Tid = $1 & extra = page \ % 3D $3 & page = $2
RewriteRule ^ space-(username | uid)-(. +) \. html $ space. php? $1 = $2
RewriteRule ^ tag-(. +) \. html $ tag. php? Name = $1

 

IIS Web Server (Independent host user)

First, add this filter on IIS Isapi. The filter name is Rewrite. Select Rewrite. dll as the executable file and restart IIS. Httpd. ini has been set in the attachment. The content is as follows:

#3600 = 1 hour
CacheClockRate 3600

RepeatLimit 32

# Protect httpd. ini and httpd. parse. errors files
# From accessing through HTTP
RewriteRule ^ (. *)/archiver/(fid | tid)-[\ w \-] + \. html )\? * (. *) $1/archiver/index \. php \? $2 & $4
RewriteRule ^ (. *)/forum-([0-9] +)-([0-9] +) \. html \? * (. *) $1/forumdisplay \. php \? Fid = $2 & page = $3 & $4
RewriteRule ^ (. *)/thread-([0-9] +)-([0-9] +)-([0-9] +) \. html \? * (. *) $1/viewthread \. php \? Tid = $2 & extra = page \ % 3D $4 & page = $3 & $4
RewriteRule ^ (. *)/space-(username | uid)-(. +) \. html \? * (. *) $1/space \. php \? $2 = $3 & $4
RewriteRule ^ (. *)/tag-(. +) \. html \? * (. *) $1/tag \. php \? Name = $2 & $3

IV. Zeus Web Server

Find Request Rewriting in VM configuration, write the following content in Rewrite Script, then Apply changes and make it take effect.

Match URL into $ with ^ (. *)/archiver/(fid | tid)-[\ w \-] + \. html )? * (. *) $
If matched then
Set URL = $1/archiver/index. php? $2 & $4
Endif
Match URL into $ with ^ (. *)/forum-([0-9] +)-([0-9] +) \. html? * (. *) $
If matched then
Set URL = $1/forumdisplay. php? Fid = $2 & page = $3 & $4
Endif
Match URL into $ with ^ (. *)/thread-([0-9] +)-([0-9] +)-([0-9] + )\. html? * (. *) $
If matched then
Set URL = $1/viewthread. php? Tid = $2 & extra = page \ % 3D $4 & page = $3 & $4
Endif
Match URL into $ with ^ (. *)/space-(username | uid)-(. + ?) \. Html? * (. *) $
If matched then
Set URL = $1/space. php? $2 = $3 & $4
Endif
Match URL into $ with ^ (. *)/tag-(. + ?) \. Html? * (. *) $
If matched then
Set URL = $1/tag. php? Name = $2 $3
Endif

 

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.