admin avatar

mediawiki 在网站根目录下的apache/openlitespeed伪静态规则

🕢 by admin





主机是cpanel ,服务器是openlitespeed

弄mediawiki 伪静态弄了好久,后来求助官方才弄好

注意,本次安装的mediawiki 程序是在网站根目录

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/(skins|images|mw-config|extensions)/
RewriteCond %{REQUEST_URI} !^/(redirect|texvc|index).php
# other notible conditions
RewriteCond %{REQUEST_URI} !^/error/(40(1|3|4)|500).html
RewriteCond %{REQUEST_URI} !^/favicon.ico
RewriteCond %{REQUEST_URI} !^/load.php
RewriteCond %{REQUEST_URI} !^/api.php
RewriteCond %{REQUEST_URI} !^/robots.txt
# Make sure there is no query string - unless user is making a search
RewriteCond %{QUERY_STRING} ^$ [OR] %{REQUEST_URI} ^/Special:Search
#I suspect that people who use /wiki will need the following line, but I'm not sure:
RewriteCond %{REQUEST_URI} ^/w$
#Rewrite URI/foo properly, this is the main rule.
RewriteRule ^(.*)$ /index.php/$1 [L,QSA,NE] # Quirk: Truncates question marks (%3F)
#RewriteRule ^(.*)http:/(.*) /$2 [R=301]

编辑LocalSettings.php文件添加下面代码

1
2
$wgScriptPath = "";
$wgArticlePath = "/$1";





💘 相关文章





写一条评论

Based on Golang + fastHTTP + sdb | go1.18.1 Processed in 2ms