document.writeln('');

在公车被猛烈进入爽文,啊灬轻点大JI巴太粗又长A片,亚洲色欲AV成人无码久久精品 ,国产大片内射1区2区,久久久网址,亚洲一区二区三区免费视频,精品欧美一区二区三区久久久,久久国产精品-久久精品

當前位置:首頁 > 免費源碼 > 如何設置Xiuno BBS URL-Rewrite

如何設置Xiuno BBS URL-Rewrite

游戲科技網2026年09月15日 03:02免費源碼60

XiunoBBS 只需要一條規則:
將 *.htm 轉發到 index.php?*.htm 即可。

Xiuno BBS 2.1 需要編輯 conf/conf.php,Xiuno BBS 3.0 不需要 1、2 步驟。
1. 編輯 conf/conf.php 中的 urlrewrite => 1,
2. 清空 tmp 目錄
3. 修改 Web Server 的 Rewrite 規則,以下為各種Web Server 的樣例:
4. 重啟 web server

Nginx:
打開 nginx 配置文件 /usr/local/nginx/conf/nginx.conf 找到對應的虛擬主機配置處,追加加粗行:

location / {
rewrite "^(.*)/(.+?).htm$" $1/index.php?$2.htm last;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^admin/(.*)\.htm$ /admin/index.php?$1.htm [L]
RewriteRule ^mobile/(.*)\.htm$ /mobile/index.php?$1.htm [L]
RewriteRule ^(.*)\.htm$ /index.php?$1.htm [L]
</IfModule>

Apache httpd.conf
如果將規則直接放入 httpd.conf 則需要在前面加 / ,看來 Apache 也反人類:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/admin/(.*)\.htm$ /admin/index.php?$1.htm [L]
RewriteRule ^/mobile/(.*)\.htm$ /mobile/index.php?$1.htm [L]
RewriteRule ^/(.*)\.htm$ /index.php?$1.htm [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 ~ "mobile/(.*.htm)" ) goto "mobile/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 ^/mobile(.*)\.htm /mobile/index.php?$1.htm [L]
RewriteRule ^/admin(.*)\.htm /admin/index.php?$1.htm [L]
RewriteRule ^(.*)\.htm /index.php?$1.htm [L]

另外一種 IIS Rewrite:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/mobile/(.*)\.htm /mobile/$1.htm [L]
RewriteRule ^/admin/(.*)\.htm /admin/$1.htm [L]
RewriteRule ^(.*)\.htm$ /$1.htm [L]