如何设置Xiuno BBS URL-Rewrite(伪静态设定)
xiunoa 2020-7-9

XiunoBBS 只需要一条规则: 将 *.htm* 转发到 index.php?*.htm* 即可。 Xiuno BBS 4.0  需要编辑 conf/conf.php 1. 编辑 'url_rewrite_on'=>1, 2. 清空 tmp 目录 Nginx: 打开 nginx 配置文件 /usr/local/nginx/conf/nginx.conf 找到对应的虚拟主机配置处,追加加粗行: location ~* \.(htm)$ {    rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last; } 然后重新启动 nginx: service nginx restart Apache: vim /etc/httpd/conf/httpd.conf    Options FollowSymLinks ExecCGI Indexes    AllowOverride all    Order deny,allow    Allow from all    Satisfy all NameVirtualHost *:80 Apache .htaccess 如果Appache 支持 .htaccess,那么可以编辑 .htaccess 文件放置于根目录下: RewriteEngine on # Apache 2.4 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*?)([^/]*)$ $1index.php?$2 [QSA,PT,L] # Apache other #RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [L] Apache httpd.conf 如果将规则直接放入 httpd.conf 则需要在前面加 / ,看来 Apache 也反人类: RewriteEngine on RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [L] 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: 1. 下载 Rewrite.zip 2. 解压到 c:\Rewrite 3. 在IIS的Isapi上添加这个筛选器, 筛选器名称Rewrite,可执行文件选择 Rewrite.dll 4. 重新启动IIS 5. httpd.ini 是配置文件,如果您了解Rewrite 规则,可以直接对其进行编辑,以下为包内设置好的Xiuno BBS的规则: [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 #RewriteRule .*\.(?:gif|jpg|png|css|js|txt|jpeg|swf|flv) $0 [I,L] #RewriteRule /httpd(?:\.ini|\.parse\.errors) / [F,I,O] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/admin(.*)\.htm(.*) /admin/index.php?$1.htm$2 [L] RewriteRule ^(.*)\.htm(.*) /index.php?$1.htm$2 [L] 另外一种 IIS Rewrite: [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/admin/(.*)\.htm(.*) /admin/$1.htm$2 [L] RewriteRule ^(.*)\.htm(.*)$ /$1.htm$2 [L] 如果要放到目录下,比如 bbs 目录,在 rewrite 规则前面加上目录即可,比如 apache .htaccess: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^bbs/admin/(.*)\.htm(.*)$ /admin/index.php?$1.htm$2 [L] RewriteRule ^bbs/(.*)\.htm(.*)$ /index.php?$1.htm$2 [L] IIS 的高版本配置方法: IIS 的高版本配置方法1:http://bbs.xiuno.com/thread-9008.htm IIS 的高版本配置方法2:http://bbs.xiuno.com/thread-9411.htm IIS 的详细配置方法请参看:http://my.oschina.net/lyx2012/blog/60198 IIS Rewrite 支持 Apache .htaccess   反人类的 IIS REWRITE!!!
-------------------------------------
作者: 过眼云烟
来源: 爱搜吧论坛 - 开源交流 共享技术|走进爱搜吧资源社区
原文链接: https://www.asouba.cn/thread-230.htm
版权声明: 若无额外声明,本帖为作者原创帖,转载请附上帖子链接!
XiunoBBS 只需要一条规则: 将 *.htm* 转发到 index.php?*.htm* 即可。 Xiuno BBS 4.0  需要编辑 conf/conf.php 1. 编辑 'url_rewrite_on'=>1, 2. 清空 tmp 目录 Nginx: 打开 nginx 配置文件 /usr/local/nginx/conf/nginx.conf 找到对应的虚拟主机配置处,追加加粗行: location ~* \.(htm)$ {    rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last; } 然后重新启动 nginx: service nginx restart Apache: vim /etc/httpd/conf/httpd.conf    Options FollowSymLinks ExecCGI Indexes    AllowOverride all    Order deny,allow    Allow from all    Satisfy all NameVirtualHost *:80 Apache .htaccess 如果Appache 支持 .htaccess,那么可以编辑 .htaccess 文件放置于根目录下: RewriteEngine on # Apache 2.4 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*?)([^/]*)$ $1index.php?$2 [QSA,PT,L] # Apache other #RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [L] Apache httpd.conf 如果将规则直接放入 httpd.conf 则需要在前面加 / ,看来 Apache 也反人类: RewriteEngine on RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [L] 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: 1. 下载 Rewrite.zip 2. 解压到 c:\Rewrite 3. 在IIS的Isapi上添加这个筛选器, 筛选器名称Rewrite,可执行文件选择 Rewrite.dll 4. 重新启动IIS 5. httpd.ini 是配置文件,如果您了解Rewrite 规则,可以直接对其进行编辑,以下为包内设置好的Xiuno BBS的规则: [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 #RewriteRule .*\.(?:gif|jpg|png|css|js|txt|jpeg|swf|flv) $0 [I,L] #RewriteRule /httpd(?:\.ini|\.parse\.errors) / [F,I,O] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/admin(.*)\.htm(.*) /admin/index.php?$1.htm$2 [L] RewriteRule ^(.*)\.htm(.*) /index.php?$1.htm$2 [L] 另外一种 IIS Rewrite: [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/admin/(.*)\.htm(.*) /admin/$1.htm$2 [L] RewriteRule ^(.*)\.htm(.*)$ /$1.htm$2 [L] 如果要放到目录下,比如 bbs 目录,在 rewrite 规则前面加上目录即可,比如 apache .htaccess: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^bbs/admin/(.*)\.htm(.*)$ /admin/index.php?$1.htm$2 [L] RewriteRule ^bbs/(.*)\.htm(.*)$ /index.php?$1.htm$2 [L] IIS 的高版本配置方法: IIS 的高版本配置方法1:http://bbs.xiuno.com/thread-9008.htm IIS 的高版本配置方法2:http://bbs.xiuno.com/thread-9411.htm IIS 的详细配置方法请参看:http://my.oschina.net/lyx2012/blog/60198 IIS Rewrite 支持 Apache .htaccess   反人类的 IIS REWRITE!!!
-------------------------------------
作者: 过眼云烟
来源: 爱搜吧论坛 - 开源交流 共享技术|走进爱搜吧资源社区
原文链接: https://www.asouba.cn/thread-230.htm
版权声明: 若无额外声明,本帖为作者原创帖,转载请附上帖子链接!
XiunoBBS 只需要一条规则: 将 *.htm* 转发到 index.php?*.htm* 即可。 Xiuno BBS 4.0  需要编辑 conf/conf.php 1. 编辑 'url_rewrite_on'=>1, 2. 清空 tmp 目录 Nginx: 打开 nginx 配置文件 /usr/local/nginx/conf/nginx.conf 找到对应的虚拟主机配置处,追加加粗行: location ~* \.(htm)$ {    rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last; } 然后重新启动 nginx: service nginx restart Apache: vim /etc/httpd/conf/httpd.conf    Options FollowSymLinks ExecCGI Indexes    AllowOverride all    Order deny,allow    Allow from all    Satisfy all NameVirtualHost *:80 Apache .htaccess 如果Appache 支持 .htaccess,那么可以编辑 .htaccess 文件放置于根目录下: RewriteEngine on # Apache 2.4 RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*?)([^/]*)$ $1index.php?$2 [QSA,PT,L] # Apache other #RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [L] Apache httpd.conf 如果将规则直接放入 httpd.conf 则需要在前面加 / ,看来 Apache 也反人类: RewriteEngine on RewriteRule ^(.*?)([^/]*)\.htm(.*)$ $1/index.php?$2.htm$3 [L] 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: 1. 下载 Rewrite.zip 2. 解压到 c:\Rewrite 3. 在IIS的Isapi上添加这个筛选器, 筛选器名称Rewrite,可执行文件选择 Rewrite.dll 4. 重新启动IIS 5. httpd.ini 是配置文件,如果您了解Rewrite 规则,可以直接对其进行编辑,以下为包内设置好的Xiuno BBS的规则: [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 #RewriteRule .*\.(?:gif|jpg|png|css|js|txt|jpeg|swf|flv) $0 [I,L] #RewriteRule /httpd(?:\.ini|\.parse\.errors) / [F,I,O] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/admin(.*)\.htm(.*) /admin/index.php?$1.htm$2 [L] RewriteRule ^(.*)\.htm(.*) /index.php?$1.htm$2 [L] 另外一种 IIS Rewrite: [ISAPI_Rewrite] # 3600 = 1 hour CacheClockRate 3600 RepeatLimit 32 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/admin/(.*)\.htm(.*) /admin/$1.htm$2 [L] RewriteRule ^(.*)\.htm(.*)$ /$1.htm$2 [L] 如果要放到目录下,比如 bbs 目录,在 rewrite 规则前面加上目录即可,比如 apache .htaccess: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^bbs/admin/(.*)\.htm(.*)$ /admin/index.php?$1.htm$2 [L] RewriteRule ^bbs/(.*)\.htm(.*)$ /index.php?$1.htm$2 [L] IIS 的高版本配置方法: IIS 的高版本配置方法1:http://bbs.xiuno.com/thread-9008.htm IIS 的高版本配置方法2:http://bbs.xiuno.com/thread-9411.htm IIS 的详细配置方法请参看:http://my.oschina.net/lyx2012/blog/60198 IIS Rewrite 支持 Apache .htaccess   反人类的 IIS REWRITE!!!
-------------------------------------
作者: 过眼云烟
来源: 爱搜吧论坛 - 开源交流 共享技术|走进爱搜吧资源社区
原文链接: https://www.asouba.cn/thread-230.htm
版权声明: 若无额外声明,本帖为作者原创帖,转载请附上帖子链接!


XiunoBBS 只需要一条规则:

将 *.htm* 转发到 index.php?*.htm* 即可。


Xiuno BBS 4.0  需要编辑 conf/conf.php

1. 编辑 'url_rewrite_on'=>1,

2. 清空 tmp 目录 



Nginx:

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


location ~* \.(htm)$ {

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

}

 

然后重新启动 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


# Apache 2.4

RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond %{REQUEST_FILENAME} !-f 

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


# Apache other

#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: 

1. 下载 Rewrite.zip

2. 解压到 c:\Rewrite

3. 在IIS的Isapi上添加这个筛选器, 筛选器名称Rewrite,可执行文件选择 Rewrite.dll

4. 重新启动IIS

5. httpd.ini 是配置文件,如果您了解Rewrite 规则,可以直接对其进行编辑,以下为包内设置好的Xiuno BBS的规则:

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

#RewriteRule .*\.(?:gif|jpg|png|css|js|txt|jpeg|swf|flv) $0 [I,L] 

#RewriteRule /httpd(?:\.ini|\.parse\.errors) / [F,I,O]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^/admin(.*)\.htm(.*) /admin/index.php?$1.htm$2 [L]
RewriteRule ^(.*)\.htm(.*) /index.php?$1.htm$2 [L]


另外一种 IIS Rewrite:

[ISAPI_Rewrite]

# 3600 = 1 hour

CacheClockRate 3600

RepeatLimit 32

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^/admin/(.*)\.htm(.*) /admin/$1.htm$2 [L]

RewriteRule ^(.*)\.htm(.*)$ /$1.htm$2 [L]



如果要放到目录下,比如 bbs 目录,在 rewrite 规则前面加上目录即可,比如 apache .htaccess:

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^bbs/admin/(.*)\.htm(.*)$ /admin/index.php?$1.htm$2 [L]

RewriteRule ^bbs/(.*)\.htm(.*)$ /index.php?$1.htm$2 [L]

</IfModule>


IIS 的高版本配置方法:

IIS 的高版本配置方法1:http://bbs.xiuno.com/thread-9008.htm

IIS 的高版本配置方法2:http://bbs.xiuno.com/thread-9411.htm

IIS 的详细配置方法请参看:http://my.oschina.net/lyx2012/blog/60198


IIS Rewrite 支持 Apache .htaccess   


反人类的 IIS REWRITE!!!




最新回复 (45)
全部楼主
  • xiunoa 超版 楼主
    2020-7-9 2
    0
    ces
  • libuwei
    2020-10-22 3
    0
    来学习。
  • xiaohei
    2020-10-31 4
    1
    下载不了啊
  • huiyueming
    2021-3-5 5
    0
    谢谢,弄好了
  • 浅唱 站长
    2021-7-15 6
    0
  • xiunoa 超版 楼主
    2021-7-15 7
    0
  • tktool
    2021-7-16 8
    0
    顶顶顶顶顶顶顶!!!
  • 4701929
    2021-7-21 9
    0
    楼主,你写得实在是太好了。我惟一能做的,就只有把这个帖子顶上去这件事了。 
  • 1978639577
    2021-8-2 10
    0
    你就是我心中的那首忐忑,总是让我惊心动魄。 
  • 1978639577
    2021-8-2 11
    0
    面对如此强贴,论遇到多大阻力,只要我一息上尚存,就绝不会让它沉沦下去,这一点请楼主放心。 
  • 1978639577
    2021-8-2 12
    0
    祝xiunobbs论坛越办越好!!!
  • 1978639577
    2021-8-2 13
    0
    非常棒!!!
  • tssz
    2021-8-16 14
    0
    祝xiunobbs论坛越办越好!!!
  • 大佬
    2021-8-19 15
    0
    祝xiunobbs论坛越办越好!!!
  • hark323
    2021-8-22 16
    0
    我要拿出这帖子奉献给世人赏阅,我要把这个帖子一直往上顶,往上顶!顶到所有人都看到为止! 
  • 伊尹
    2021-8-24 17
    0
  • 李天一
    2021-8-29 18
    0
    伪静态有啥用?
  • 35921692
    2021-9-3 19
    0
    支持老大
  • oygs666
    2021-9-19 20
    0
    我要拿出这帖子奉献给世人赏阅,我要把这个帖子一直往上顶,往上顶!顶到所有人都看到为止! 
  • oygs666
    2021-9-19 21
    0
    面对如此强贴,论遇到多大阻力,只要我一息上尚存,就绝不会让它沉沦下去,这一点请楼主放心。 
  • oygs666
    2021-9-19 22
    1
    楼主,我只是来混个熟的!老板,侬亿雷凑闹嫩了!
  • Asun
    2021-10-2 23
    0
    支持!
  • suijiong222
    2022-1-20 24
    0
    李天一 伪静态有啥用?
    美化链接
    如/?thread-1.htm——>/thread-1.htm
  • zhouying82
    2022-3-19 25
    0
    XiunoBBS 只需要一条规则:

    将 *.htm* 转发到 index.php?*.htm* 即可。//我用的是4.04版本,这句话看不懂啊,怎么个操作法呢?



    Xiuno BBS 4.0  需要编辑 conf/conf.php

    1. 编辑 'url_rewrite_on'=>1,

    2. 清空 tmp 目录 

  • ricky
    2022-5-14 26
    0
    ng伪静态搞了链接还是有个? 怎么解决呢。
  • heavenworld
    2022-7-17 27
    0
     'url_rewrite_on'=>1,登陆不上了。 /usr/local/nginx/conf/nginx.conf   nginx.conf的路径也不对,不知道哪里去找
  • 伊尹
    2022-7-23 28
    0
    顶顶顶顶顶顶顶!!!
  • MRMELON
    2022-9-17 29
    0
    改完之后进不去网站了
  • kkapi
    2022-9-26 30
    0
    哈哈,不错哦!
  • 章鱼猫
    2022-9-29 31
    0

    发现安装插件时候,点击安装后,提示安装成功,但是却不显示效果,跟这个设置伪静态有关吗?

    我的 Nginx 下把伪静态设置于添加到了下面位置,重启 Nginx 好像也没什么变化,希望有人能指点一下~

    server
        {
            listen 80 default_server reuseport;
            #listen [::]:80 default_server ipv6only=on;
            server_name _;
            index index.html index.htm index.php;
            root  /home/wwwroot/default;
    
            #error_page   404   /404.html;
    
            # Deny access to PHP files in specific directory
            #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
    
            include enable-php.conf;
    
            location /nginx_status
            {
                stub_status on;
                access_log   off;
            }
            location ~* \.(htm)$ {
                rewrite "^(.*)/(.+?).htm(.*?)$" $1/index.php?$2.htm$3 last;
            }
    
            location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
            {
                expires      30d;
            }
    
            location ~ .*\.(js|css)?$
            {
                expires      12h;
            }
    
            location ~ /.well-known {
                allow all;
            }
    
            location ~ /\.
            {
                deny all;
            }
    
            access_log  /home/wwwlogs/access.log;
        }
    
  • qiange2018
    2022-10-21 32
    0
    设置之后首页打不开 其他页面可以是什么情况
  • waltshen
    2022-11-12 33
    0
    哈哈,不错哦!
  • nxxxx117
    2022-12-27 34
    0
    哈哈,不错哦!
  • Tillreetree 版主
    2023-1-29 35
    1
    这帖子里的Apache部分误导了一大堆的人……其实两种版本是分开的,不是复制粘贴就完事的
  • 有无之间
    2023-2-24 36
    0
    顶顶顶顶顶顶顶!!!
  • stl176
    2023-3-9 37
    0
    哈哈,不错哦!
  • xiunoa 超版 楼主
    2023-3-29 38
    0
    Tillreetree 这帖子里的Apache部分误导了一大堆的人……其实两种版本是分开的,不是复制粘贴就完事的
  • xuyuguo
    2023-4-9 39
    0
    学习了,好用,顶!!!!!!!!!!!!!
  • 9978
    10月前 40
    0
    非常棒!!!
  • lyqbing2
    8月前 41
    0
    祝xiunobbs论坛越办越好!!!
  • xingzhe
    7月前 42
    0
    不错的帖子!
  • solomon
    3月前 43
    0
    感谢楼主ing!!!
  • ruixing0731
    1月前 44
    0
    不知道如何开启,能访问。总是加了个?号
  • weige
    1月前 45
    0
    祝xiunobbs论坛越办越好!!!
  • neox
    15天前 46
    0
    不错的帖子!
返回