帮助:伪静态:修订间差异
外观
创建页面,内容为“Nginx安装Mediawiki后,假设安装在网站根目录。 对nginx的rewrite文件写入如下内容 <code>location ~ ^\/.+$ {</code> <code>if ($request_uri ~ ^…” |
|||
| (未显示同一用户的1个中间版本) | |||
| 第22行: | 第22行: | ||
<code>$wgUsePathInfo = true;</code> | <code>$wgUsePathInfo = true;</code> | ||
[[分类:网站帮助]] | |||
2022年4月3日 (日) 02:07的最新版本
Nginx安装Mediawiki后,假设安装在网站根目录。
对nginx的rewrite文件写入如下内容
location ~ ^\/.+$ {
if ($request_uri ~ ^/images) { break; }
if ($request_uri ~ ^/resources) { break; }
if ($request_uri ~ ^/index\.php) { break; }
rewrite ^/(.+)$ /index.php?title=$1 last;
}
随后在LocalSettings.php
$wgScriptPath = "";
$wgArticlePath = "/w/$1";
$wgUsePathInfo = true;