xiunobbs开启伪静态教程

admin9个月前 (01-27)百科知识237

XiunoBBS 只需将 *.htm* 转发到 index.php?*.htm*即可


所有网站伪静态开启好后,需要编辑 conf/conf.php文件,才能完全开启!


1. 编辑 'url_rewrite_on'=>1,


2. 清空 tmp 目录


或 下载大白的拓展设置插件,后台首页点击设置,点击拓展设置,开启伪静态,导航栏点击其他,点击清理缓存。


nginx

1.打开 nginx 配置文件 /usr/local/nginx/conf/nginx.conf 找到对应的虚拟主机配置处,追加加红加粗行:


location ~* \.(htm)$ {


    rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;


}


然后重新启动 nginx: service nginx restart


2.宝塔板面,直接在网站配置页面,点击伪静态,填写


location ~* \.(htm)$ {


        rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;


}

即可


apache

在网站根目录创建文件 .htaccess,内容如下:


<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*?)([^/]*)$ $1index.php?$2[QSA,PT,L]

</IfModule>

sae环境

在网站根目录创建文件config.yaml,内容如下:


appname: axiuno

version: 1

handle:

- rewrite: if ( !is_dir() && !is_file() && path ~ "admin/(.*.htm)" ) goto "admin/index.php?%1"


- rewrite: if ( !is_dir() && !is_file() && path ~ "[^/?].htm" ) goto "index.php?%1"

据xiuno作者所说,IIS的伪静态设定比较反人类,我这边就不描述了,可以在百度搜索一下其他xiuno爱好者平台有没有相关文章。