常用建站程序伪静态代码分享

  • 还在为你的网站找不到对应的伪静态代码而烦恼吗?
  • 还在苦苦的网上一次又一次的百度搜索吗?
  • 不,通通不需要,本文总结并且整理了市面上常用的建站伪静态代码供你使用
  • 如果觉得对你有用欢迎点个赞、留个言,让我知道你来过哦~

WordPress

location /
{
	 try_files $uri $uri/ /index.php?$args;
}

rewrite /wp-admin$ $scheme://$host$uri/ permanent;

Typecho

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

Zblog

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;
}

emlog

location / {
index index.php index.html;
	if (!-e $request_filename)
	{
		rewrite ^/(.*)$ /index.php last;
	}
}

discuzx

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;
rewrite ^([^\.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_\-]+)\.html$ $1/plugin.php?id=$2:$3 last;
if (!-e $request_filename) {
	return 404;
}

thinkphp

location / {
	if (!-e $request_filename){
		rewrite  ^(.*)$  /index.php?s=$1  last;   break;
	}
}

© 版权声明
THE END
文章不错?点个赞呗
点赞7赞赏
分享
评论 抢沙发
小语雀的头像-小语雀网

昵称

取消
昵称表情代码图片