ThinkSAAS Nginx 的偽靜態(tài)(Rewrite)規(guī)則

ThinkSAAS是一個(gè)輕量級的開源社區(qū)系統(tǒng),是一個(gè)可以用來搭建討論組,bbs和圈子的社區(qū)系統(tǒng)。

江陰人就是采用的ThinkSAAS程序。

把下面代碼存為thinksaas.conf,然后在域名配置文件(jyr.me.conf)中嵌入(include thinksaas.conf)就行了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
location /
{
    if (-f $request_filename/index.html)
    {
        rewrite (.*) $1/index.html break;
    }

    if (-f $request_filename/index.php)
    {
        rewrite (.*) $1/index.php;
    }

    if (!-f $request_filename)
    {
        rewrite (.*) /index.php;
    }
}

WordPress Multisite Nginx 的偽靜態(tài)(Rewrite)規(guī)則

  WordPress是一個(gè)注重美學(xué)、易用性和網(wǎng)絡(luò)標(biāo)準(zhǔn)的個(gè)人信息發(fā)布平臺。WordPress 雖為免費(fèi)的開源軟件,但其價(jià)值是無法用金錢來衡量。使用WordPress可以搭建功能強(qiáng)大的網(wǎng)絡(luò)信息發(fā)布平臺,但更多的是應(yīng)用于個(gè)性化的博客。針對博客的應(yīng)用,WordPress能讓您省卻對后臺技術(shù)的擔(dān)心,集中精力做好網(wǎng)站的內(nèi)容。

珂亦網(wǎng)絡(luò)科技采用WordPress ,并開啟了多站點(diǎn)功能,裝了Domain Mapping插件來管理子站點(diǎn)。

把下面代碼存為wordpress.conf,然后在域名配置文件(koryi.com.conf)中嵌入(include wordpress.conf)就行了,些規(guī)則也適合單用戶WordPress

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
location ^~ /files/ {
    rewrite ^.*/files/(.*) /wp-includes/ms-files.php?file=$1 last;
}

location / {
    server_name_in_redirect off;
    port_in_redirect off;

    if (!-e $request_filename) {
        rewrite ^.+?(/wp-.*) $1 last;
        rewrite ^.+?(/.*\.php)$ $1 last;
        rewrite ^ /index.php last;
    }

    if (!-e $request_filename) {
        return 404;
    }
}

location ^~ /blogs.dir/ {
    internal;
    root /home/www/wordpress/wp-content;
}

Discuz!X Nginx 的偽靜態(tài)(Rewrite)規(guī)則

Discuz!X是康盛創(chuàng)想(Comsenz)推出的一個(gè)以社區(qū)為基礎(chǔ)的專業(yè)建站平臺,讓論壇(BBS)、個(gè)人空間(SNS)、門戶(Portal)、群組(Group)、應(yīng)用開放平臺(Open Platform)充分融合于一體,幫助網(wǎng)站實(shí)現(xiàn)一站式服務(wù)。

江陰論壇就是建立在Discuz!X的一個(gè)江陰本地論壇。

把下面代碼存為discuzx.conf,然后在域名配置文件(jyrj.net.conf)中嵌入(include discuzx.conf)就行了。

1
2
3
4
5
6
7
8
9
10
11
12
13
location / {
    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;
    if (!-e $request_filename) {
        return 404;
    }
}

ECShop Nginx 的偽靜態(tài)(Rewrite)規(guī)則

ECShop是一款開源免費(fèi)的網(wǎng)上商店系統(tǒng)。由專業(yè)的開發(fā)團(tuán)隊(duì)升級維護(hù),為您提供及時(shí)高效的技術(shù)支持,您還可以根據(jù)自己的商務(wù)特征對ECShop進(jìn)行定制,增加自己商城的特色功能。

把下面代碼存為ecshop.conf,然后在域名配置文件(romangift.com.conf)中嵌入(include ecshop.conf)就行了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
location / {
    if (!-e $request_filename) {
        rewrite "^/index\.html" /index.php last;
        rewrite "^/category$" /index.php last;
        rewrite "^/feed-c([0-9]+)\.xml$" /feed.php?cat=$1 last;
        rewrite "^/feed-b([0-9]+)\.xml$" /feed.php?brand=$1 last;
        rewrite "^/feed\.xml$" /feed.php last;
        rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5&page=$6&sort=$7&order=$8 last;
        rewrite "^/category-([0-9]+)-b([0-9]+)-min([0-9]+)-max([0-9]+)-attr([^-]*)(.*)\.html$" /category.php?id=$1&brand=$2&price_min=$3&price_max=$4&filter_attr=$5 last;
        rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3&sort=$4&order=$5 last;
        rewrite "^/category-([0-9]+)-b([0-9]+)-([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2&page=$3 last;
        rewrite "^/category-([0-9]+)-b([0-9]+)(.*)\.html$" /category.php?id=$1&brand=$2 last;
        rewrite "^/category-([0-9]+)(.*)\.html$" /category.php?id=$1 last;
        rewrite "^/goods-([0-9]+)(.*)\.html" /goods.php?id=$1 last;
        rewrite "^/article_cat-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /article_cat.php?id=$1&page=$2&sort=$3&order=$4 last;
        rewrite "^/article_cat-([0-9]+)-([0-9]+)(.*)\.html$" /article_cat.php?id=$1&page=$2 last;
        rewrite "^/article_cat-([0-9]+)(.*)\.html$" /article_cat.php?id=$1 last;
        rewrite "^/article-([0-9]+)(.*)\.html$" /article.php?id=$1 last;
        rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)\.html" /brand.php?id=$1&cat=$2&page=$3&sort=$4&order=$5 last;
        rewrite "^/brand-([0-9]+)-c([0-9]+)-([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2&page=$3 last;
        rewrite "^/brand-([0-9]+)-c([0-9]+)(.*)\.html" /brand.php?id=$1&cat=$2 last;
        rewrite "^/brand-([0-9]+)(.*)\.html" /brand.php?id=$1 last;
        rewrite "^/tag-(.*)\.html" /search.php?keywords=$1 last;
        rewrite "^/snatch-([0-9]+)\.html$" /snatch.php?id=$1 last;
        rewrite "^/group_buy-([0-9]+)\.html$" /group_buy.php?act=view&id=$1 last;
        rewrite "^/auction-([0-9]+)\.html$" /auction.php?act=view&id=$1 last;
        rewrite "^/exchange-id([0-9]+)(.*)\.html$" /exchange.php?id=$1&act=view last;
        rewrite "^/exchange-([0-9]+)-min([0-9]+)-max([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&integral_min=$2&integral_max=$3&page=$4&sort=$5&order=$6 last;
        rewrite "^/exchange-([0-9]+)-([0-9]+)-(.+)-([a-zA-Z]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2&sort=$3&order=$4 last;
        rewrite "^/exchange-([0-9]+)-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1&page=$2 last;
        rewrite "^/exchange-([0-9]+)(.*)\.html$" /exchange.php?cat_id=$1 last;
    }

    if (!-e $request_filename) {
        return 404;
    }
}

記事狗 Nginx 的偽靜態(tài)(Rewrite)規(guī)則

記事狗微博系統(tǒng)是一套業(yè)界領(lǐng)先的開源PHP微博程序,其支持Web、手機(jī)、短信、QQ機(jī)器人等多種方式發(fā)布內(nèi)容,并可通過QQ即時(shí)通知、站外調(diào)用、同步到新浪微博、騰訊微博(可使用微博賬戶登錄、注冊綁定)等傳播內(nèi)容,是現(xiàn)在最熱門、最火爆的互動系統(tǒng)。記事狗微博集成了Ucenter模塊,可與所有集成該模塊的系統(tǒng)(比如Discuz、Ecshop等)進(jìn)行無縫整合,完美實(shí)現(xiàn)用戶同步注冊、登陸、退出,同步上傳頭像,同步修改密碼,讓網(wǎng)站已有用戶輕松使用。

把下面代碼存為jsg.conf,然后在域名配置文件(t.jyrj.net.conf)中嵌入(include jsg.conf)就行了。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
location / {
    if (-f $request_filename/index.html){
        rewrite (.*) $1/index.html break;
    }

    if (-f $request_filename/index.php){
        rewrite (.*) $1/index.php;
    }

    if (!-f $request_filename){
        rewrite (.*) /index.php;
    }

    if (!-e $request_filename) {
        return 404;
    }
}