三二互联专业提供速度最快最稳定的美国服务器、香港服务器。中美直连,亚洲优化![ 代理登陆 ] [ 付款方式 ] [ 找回密码 ][ 电子协议责任书 ]
硬件资源保障

采用高配品牌服务器

主流强悍CPU配置

确保服务高速稳定运行

中美直连线路

中美直连亚洲优化

采用中国CN2骨干网络

保证速度飞快稳定高效

宝塔面板的预设伪静态规则列表

美国、香港服务器

宝塔面板的预设伪静态规则列表

02-07   来源:

 宝塔面板为多种常见的网站程序提供了预设的伪静态规则,以下是一些常见程序的预设伪静态规则:

WordPress
plaintext
if (!-e $request_filename) {
    rewrite ^.*$ /index.php last;
}
该规则会将所有非实际文件和目录的请求重写为对index.php的请求,WordPress 会根据 URL 参数来处理具体的页面显示。
Discuz!
plaintext
if (!-e $request_filename) {
    rewrite ^([^\.]*)/topic-(.+)\.html$ /portal.php?mod=topic&topic=$2 last;
    rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ /portal.php?mod=view&aid=$2&page=$3 last;
    rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ /forum.php?mod=forumdisplay&fid=$2&page=$3 last;
    rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
    rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ /forum.php?mod=group&fid=$2&page=$3 last;
    rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ /home.php?mod=space&$2=$3 last;
    rewrite ^([^\.]*)/blog-([0-9]+)-([0-9]+)\.html$ /home.php?mod=space&uid=$2&do=blog&id=$3 last;
    rewrite ^([^\.]*)/archiver/((fid|tid)-[0-9]+\.html)$ /archiver/index.php?$2 last;
    rewrite ^([^\.]*)/plugin.php?id=([^:]+):([^&]+)&([^=]+)=(.*)$ /plugin.php?id=$2:$3&$4=$5 last;
}
Discuz! 是一个流行的论坛程序,这个规则将不同类型的动态 URL 重写为静态形式,方便搜索引擎收录和用户记忆。
Typecho
plaintext
if (!-e $request_filename) {
    rewrite ^(.*)$ /index.php$1 last;
}
Typecho 是一款轻量级的博客程序,该规则把所有非真实文件的请求都重定向到index.php进行处理。
ThinkPHP(部分版本)
plaintext
location / {
    if (!-e $request_filename) {
        rewrite ^(.*)$ /index.php?s=$1 last;
    }
}
ThinkPHP 是一个广泛使用的 PHP 开发框架,此规则将 URL 重写为index.php?s=参数的形式,以实现路由功能。
Laravel
plaintext
location / {
    try_files $uri $uri/ /index.php?$query_string;
}
Laravel 是一个功能强大的 PHP 框架,该规则会先尝试访问实际的文件或目录,如果不存在则将请求转发到index.php处理。

三二互联专业提供香港VPS,美国VPS主机,香港云服务器租用等业务香港美国到大陆CN2 GIA速度最快

上一篇:没有了 下一篇:如何在宝塔面板中配置网站的伪静态规则?

美国GIA服务器三二互联版权所有 WWW.222.cc 2008-2015 All Rights Reserved
三二互联 - 专业的美国C3服务器香港vps、抗DOOS流量清洗、云备份系统、网站加速系统、美国GIA服务器和香港云服务器产品提供商
三二互联24小时在线工单系统为您提供全面、专业、周到的技术支持与服务
咨询热线:400-679-9994(免长话费)