document.writeln('');

国产精品最大AV站在线观看,a级黄毛片试看三分钟,AV无码A片高潮AV,国产午夜精品一区二区三区,久久爆乳不卡一区,日本三级欧美三级,日韩精品AV一二三区在线,高H短篇小说抽插

當(dāng)前位置:首頁 > 免費(fèi)源碼 > 如何設(shè)置Xiuno BBS URL-Rewrite

如何設(shè)置Xiuno BBS URL-Rewrite

XiunoBBS 只需要一條規(guī)則:
將 *.htm 轉(zhuǎn)發(fā)到 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 規(guī)則,以下為各種Web Server 的樣例:
4. 重啟 web server

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

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
如果將規(guī)則直接放入 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環(huán)境,根目錄建立 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,可執(zhí)行文件選擇 Rewrite.dll
4. 重新啟動IIS
5. httpd.ini 是配置文件,如果您了解Rewrite 規(guī)則,可以直接對其進(jìn)行編輯,以下為包內(nèi)設(shè)置好的Xiuno BBS的規(guī)則:
[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]