[源码设置] 如何设置Xiuno BBS URL-Rewrite(伪静态设定)
作者:CC下载站 日期:2024-03-22 12:44:57 浏览:28 分类:站长帮
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 ^(.*)\.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!!!
猜你还喜欢
- 06-04 [站长技术] 如何开启WordPress Multisite多站点网络
- 03-29 [环境测试] Hexo部署GitHub Pages
- 03-22 [源码设置] 如何设置Xiuno BBS URL-Rewrite(伪静态设定)
- 03-06 [建站交流] PicGo + smms 构建图床
- 11-18 [emlog技巧] Emlog非插件显示评论者IP属地
- 11-09 [网站维护] WordPress 后台速度慢?加快仪表板速度的 15 种方法
- 11-09 [WordPress插件] 10 个最好用的 WordPress 聊天机器人插件(免费和付费)
- 11-09 [WordPress开发] 探索 WordPress 6.3 中的增强样板(Patterns)
- 11-09 [网站维护] 无需插件即可优化 WordPress 速度的 12 种策略
- 11-09 [网站安全] WordPress 安全统计:WordPress 到底有多安全?
- 09-20 [jsp技术] JSP ssm 特殊人群防走失系统myeclipse开发mysql数据库springMVC模式java编程计算机网页设计
- 09-15 [Lightsail容器] AWS Lightsail VPS:一种在云中运行容器的简单方法
取消回复欢迎 你 发表评论:
- 精品推荐!
-
- 最新文章
- 热门文章
- 热评文章
[影视剧] 2024上半年熬夜必追的10部剧
[模拟经营] 模拟人生4豪华版/The Sims 4 Deluxe Edition
[模拟经营] 【沙威玛传奇】无广告版本+无限金币版本
[动作冒险] 侠盗猎车手5 MOD可剧情版/GTA5 MOD可剧情版/Grand Theft Auto V5
[游戏合集] 要战便战 v0.9.107 免安装绿色中文版
[有声小说] 《读心师》作者:向林 主播: 章鱼 53回完结
[有声小说] 《异悚》作者:黑色火种 演播:冰河 195集完结
[有声小说] 《盛华》作者:闲听落花 主播:姝姝 465集完结
[有声小说] 《修真聊天群》作者:圣骑士的传说 主播:云天河 3120集完结
[课程] 2024最新易语言基础快速入门到精通教程:1天入门快速开发自己的软件
[文件编辑] WinHex 21.2 SR-2_x86_x64 绿色单文件版
[图片浏览] 2345看图王去广告安装版 x86 x64 11.3.0.10165
[电影] 死侍与金刚狼 DeadPool.And.Wolverine.2024.V4.2160p [MP4]
[游戏] 《黑神话悟空》免安装学习版【全dlc整合完整版】+Steam游戏解锁+游戏修改工具!
[涨点姿势] 男性性技宝典:14招实战驭女术——爱抚、按摩、催情、姿势、高潮全攻略
[美剧] [黑袍纠察队 第四季][全8集][MKV][中文字幕][1080P]
[电视剧集] [BT下载][黑暗城市- 清扫魔 Dark City: The Cleaner 第一季][全06集][英语无字][MKV][720P/1080P][WEB-RAW]
[短剧] 被下架·禁播的羞羞短剧·午夜短剧合集
[资料] 知识星球【生财有术】付费内容
[动画] 《名侦探柯南》名侦探柯南百万美元的五菱星 [TC] [MP4]
[影视] 美国内战 4K蓝光原盘下载+高清MKV版/内战/帝国浩劫:美国内战(台)/美帝崩裂(港) 2024 Civil War 63.86G
[美剧] [黑袍纠察队 第四季][全8集][MKV][中文字幕][1080P]
[电影] 《黄飞鸿》全系列合集
[瓜] 恒大歌舞团被扒,意外暴露惊人内幕,难怪许家印商业帝国会崩盘
[Android] 开罗游戏 ▎像素风格的模拟经营的游戏厂商安卓游戏大合集
[游戏合集] 要战便战 v0.9.107 免安装绿色中文版
[资源] 精整2023年知识星球付费文合集136篇【PDF格式】
[文件编辑] WinHex 21.2 SR-2_x86_x64 绿色单文件版
[图片浏览] 2345看图王去广告安装版 x86 x64 11.3.0.10165
[美图] 【经典收藏美图集合】1500多张韩国美女高清图片让你的收藏夹更加丰富多彩
- 最新评论
-
找了好久的资源,终于在这里找到了。感谢本站的资源和分享。谢谢WillKwok 评论于:10-09 帖子里不是写着么【相关密码】:www.52sk2.comCC下载站 评论于:10-07 感谢分享1234123 评论于:10-07 百度网盘怎么还有个解压码啊,解压码是什么lrq2004042 评论于:10-07 太好了终于找到了谢谢Tom 评论于:10-07 谢谢分享loonghd 评论于:09-30 好多演員都出演過黃飛鴻,但還是李連杰最突出338 评论于:09-30 很喜欢,感谢分享1506098895 评论于:09-22 寻回童年回忆AnDemon 评论于:09-21 不错,不错剧毒 评论于:09-07
- 热门tag