使用教程

TUTUCMS针对不同环境的伪静态生成

日期:2015-10-20 08:41:49 来源:TUTUCMS

Apache Web Server(虚拟主机用户)

RewriteEngine On

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/list-([0-9]+)\.html$ $1/index.php?c=Cate&cid=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/list-([0-9]+)-([0-9]+)\.html$ $1/index.php?c=Cate&cid=$2&p=$3


RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/topic\.html$ $1/index.php?c=Topic

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/topic_([0-9]+)\.html$ $1/index.php?c=Topic&p=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/topic-([0-9]+)\.html$ $1/index.php?c=Topic&tid=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/topic-([0-9]+)-([0-9]+)\.html$ $1/index.php?c=Topic&tid=$2&p=$3

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/topic-(\w+)\.html$ $1/index.php?c=Topic&ename=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/topic-(\w+)-([0-9]+)\.html$ $1/index.php?c=Topic&ename=$2&p=$3


RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/system-([0-9]+)\.html$ $1/index.php?c=System&id=$2


RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/tags-all\.html$ $1/index.php?c=Tags&a=all

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/tags-all-p-([0-9]+)\.html$ $1/index.php?c=Tags&a=all&p=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/tags-(.*)-([0-9]+)\.html$ $1/index.php?c=Tags&tag=$2&p=$3

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/tags-(.*)\.html$ $1/index.php?c=Tags&tag=$2


RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/search-(.*)-([0-9]+)\.html$ $1/index.php?c=Search&keyword=$2&p=$3

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/search-(.*)\.html$ $1/index.php?c=Search&keyword=$2


RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/archiver-index\.html$ $1/index.php?c=Archiver

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/archiver-index-p-([0-9]+)\.html$ $1/index.php?c=Archiver&p=$2

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/maps-index\.html$ $1/index.php?c=Maps

RewriteCond %{QUERY_STRING} ^(.*)$

RewriteRule ^(.*)/maps-rss\.html$ $1/index.php?c=Maps&a=rss


IIS Web Server(独立主机用户)

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

# Protect httpd.ini and httpd.parse.errors files

# from accessing through HTTP

RewriteRule ^(.*)/list-([0-9]+)\.html$ $1/index\.php\?c=Cate&cid=$2

RewriteRule ^(.*)/list-([0-9]+)-([0-9]+)\.html$ $1/index\.php\?c=Cate&cid=$2&p=$3


RewriteRule ^(.*)/article-([0-9]+)\.html$ $1/index\.php\?c=Article&id=$2

RewriteRule ^(.*)/article-([0-9]+)-([0-9]+)\.html$ $1/index\.php\?c=Article&id=$2&p=$3


RewriteRule ^(.*)/topic\.html$ $1/index\.php\?c=Topic

RewriteRule ^(.*)/topic_([0-9]+)\.html$ $1/index\.php\?c=Topic&p=$2

RewriteRule ^(.*)/topic-([0-9]+)-([0-9]+)\.html$ $1/index\.php\?c=Topic&tid=$2&p=$3

RewriteRule ^(.*)/topic-([0-9]+)\.html$ $1/index\.php\?c=Topic&tid=$2

RewriteRule ^(.*)/topic-(\w+)\.html$ $1/index\.php\?c=Topic&ename=$2

RewriteRule ^(.*)/topic-(\w+)-([0-9]+)\.html$ $1/index\.php\?c=Topic&ename=$2&p=$3


RewriteRule ^(.*)/system-([0-9]+)\.html$ $1/index\.php\?c=System&id=$2


RewriteRule ^(.*)/tags-all\.html$ $1/index\.php\?c=Tags&a=all

RewriteRule ^(.*)/tags-all-p-([0-9]+)\.html$ $1/index\.php\?c=Tags&a=all&p=$2

RewriteRule ^(.*)/tags-(.*)-([0-9]+)\.html$ $1/index\.php\?c=Tags&tag=$2&p=$3

RewriteRule ^(.*)/tags-(.*)\.html$ $1/index\.php\?c=Tags&tag=$2


RewriteRule ^(.*)/search-(.*)-([0-9]+)\.html$ $1/index\.php\?c=Search&keyword=$2&p=$3

RewriteRule ^(.*)/search-(.*)\.html$ $1/index\.php\?c=Search&keyword=$2


RewriteRule ^(.*)/archiver-index\.html$ $1/index\.php\?c=Archiver

RewriteRule ^(.*)/archiver-index-p-([0-9]+)\.html$ $1/index\.php\?c=Archiver&p=$2

RewriteRule ^(.*)/maps-index\.html$ $1/index\.php\?c=Maps

RewriteRule ^(.*)/maps-rss\.html$ $1/index\.php\?c=Maps&a=rss



Nginx Web Server

rewrite ^([^\.]*)/list-([0-9]+)\.html$ $1/index.php?c=Cate&cid=$2 last;

rewrite ^([^\.]*)/list-([0-9]+)-([0-9]+)\.html$ $1/index.php?c=Cate&cid=$2&p=$3 last;


rewrite ^([^\.]*)/article-([0-9]+)\.html$ $1/index.php?c=Article&id=$2 last;

rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/index.php?c=Article&id=$2&p=$3 last;


rewrite ^([^\.]*)/topic\.html$ $1/index.php?c=Topic last;

rewrite ^([^\.]*)/topic_([0-9]+)\.html$ $1/index.php?c=Topic&p=$2 last;

rewrite ^([^\.]*)/topic-([0-9]+)-([0-9]+)\.html$ $1/index.php?c=Topic&tid=$2&p=$3 last;

rewrite ^([^\.]*)/topic-([0-9]+)\.html$ $1/index.php?c=Topic&tid=$2 last;

rewrite ^([^\.]*)/topic-(\w+)\.html$ $1/index.php?c=Topic&ename=$2 last;

rewrite ^([^\.]*)/topic-(\w+)-([0-9]+)\.html$ $1/index.php?c=Topic&ename=$2&p=$3 last;


rewrite ^([^\.]*)/system-([0-9]+)\.html$ $1/index.php?c=System&id=$2 last;


rewrite ^([^\.]*)/tags-all\.html$ $1/index.php?c=Tags&a=all last;

rewrite ^([^\.]*)/tags-all-p-([0-9]+)\.html$ $1/index.php?c=Tags&a=all&p=$2 last;

rewrite ^([^\.]*)/tags-(.*)-([0-9]+)\.html$ $1/index.php?c=Tags&tag=$2&p=$3 last;

rewrite ^([^\.]*)/tags-(.*)\.html$ $1/index.php?c=Tags&tag=$2 last;


rewrite ^([^\.]*)/search-(.*)-([0-9]+)\.html$ $1/index.php?c=Search&keyword=$2&p=$3 last;

rewrite ^([^\.]*)/search-(.*)\.html$ $1/index.php?c=Search&keyword=$2 last;


rewrite ^([^\.]*)/archiver-index\.html$ $1/index.php?c=Archiver last;

rewrite ^([^\.]*)/archiver-index-p-([0-9]+)\.html$ $1/index.php?c=Archiver&p=$2 last;

rewrite ^([^\.]*)/maps-index\.html$ $1/index.php?c=Maps last;

rewrite ^([^\.]*)/maps-rss\.html$ $1/index.php?c=Maps&a=rss last;

if (!-e $request_filename) {

return 404;

}