XiunoBBS伪静态设置方法及代码教程

已认证 已通过实名认证 xiuno
管理员
官方成员
2021-2-24 1993

XiunoBBS 只需要一条规则:
将 *.htm* 转发到 index.php?*.htm* 即可。


Xiuno BBS 4.0 / 2.0 需要编辑 conf/conf.php
1. 编辑 'url_rewrite_on'=>1,
2. 清空 tmp 目录



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


location / { 
    rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;
    index    index.html index.htm index.php;
     root     /data/wwwroot/xiuno.com;
}


然后重新启动 nginx: service nginx restart


Apache: 
vim /etc/httpd/conf/httpd.conf
<Directory d:/xiuno.com>
    Options FollowSymLinks ExecCGI Indexes
    AllowOverride all
    Order deny,allow
    Allow from all
    Satisfy all
</Directory>
NameVirtualHost *:80


Apache .htaccess
如果Appache 支持 .htaccess,那么可以编辑 .htaccess 文件放置于根目录下:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [L]
</IfModule>


Apache httpd.conf
如果将规则直接放入 httpd.conf 则需要在前面加 / ,看来 Apache 也反人类:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [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"



IIS:
最后于 2021-2-24 被xiuno编辑 ,原因:
资源下载(本站资源请使用电脑winrar进行解压!):

未登录提示:


关闭
他们喜欢这个资源
  • zxsrr
  • wtbbb
  • qwera
  • ruixing0731
  • dominik
  • 15877404804
  • chensheng666
  • 好人
  • xuefei
  • gunjack945
  • wu13
  • tenyet
  • 失落的神殿
最新回复 (0)
    • Xiuno顶尖网
      2
        登陆 注册
  • 失落的神殿
    2
     点击可以快捷回复 感谢 支持 不错 无奈 一般 生气 回帖 路过 顶帖
    表情
在线客服

特别说明

QQ客服仅提供有偿服务,如无付费意愿,请勿扰!一般问题请站内发帖咨询!
服务项目:
1,xiuno插件模板定制开发
2,xiuno网站BUG修复
3,xiuno个性化定制
4,xiuno仿站等

客服工作时间:8:00~22:00
在线客服