262 0 0

XiunoBBS伪静态设置方法 教程

 陈哥 V UID:1 地仙境创始人
2025-02-26 3189  来自 仙界

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 找到对应的虚拟主机配置处,追加加粗行:

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:建议用宝塔配置更方便

<?xml version="1.0" ?>

<rules>

    <rule name="xiuno3_rewrite">

        <match url="^((.*)/)?(.+).htm$"/>

        <action type="Rewrite" url="{R:1}\index.php?{R:2}.htm"/>

    </rule>

</rules>

 

 

附件详情

  • 说明: 每次点击下载扣除1金币
  • 附件名:
    加载中...
  • 附件分类: 教程
  • 账户经验: 0 点 [排行]
  • 账户金币: 0 个 [兑换]
  • 账户灵石: 0 枚 [充值]
  • 上传用户:  陈哥 时间:2025-02-26
  • 下载地址:
相关帖子
看过的人 (3)
  •  yh745234
  • leostudio
  • 爱萌社
最新回复 (262)
  • 懵蓝初 UID:10134 练气期
    2025-03-07  来自 仙界
    263

    登录后可见回帖内容

    签名:http://bbs.cswl.top/
  • 青梅染雪 UID:10109 练气期
    2025-03-07  来自 仙界
    262

    登录后可见回帖内容

    签名:http://bbs.cswl.top/
  • 夏末烟雨 UID:10138 练气期
    2025-03-07  来自 仙界
    261

    登录后可见回帖内容

    签名:http://bbs.cswl.top/

请先登录后发表评论!

返回
每日签到
今日共0人签到
请先登录
周一
周二
周三
周四
周五
周六
周日

2025年乙巳年蛇年
13:36:00
公历日期
9月26日
农历日期
八月初五
星期
星期五
下午好
金秋时节,愿您收获满满
距离国庆节还有5天

请先登录后发表评论!