宝塔面板 + Nginx
1、vhost上配置重定向,准确路径为/www/server/panel/vhost/nginx找到对应的网站文件,如www.emc.wiki.conf

location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
        try_files $uri /index.php;
        expires max;
        log_not_found off;
    }

    location = /_.gif {
        expires max;
        empty_gif;
    }

    location ^~ /cache/ {
        deny all;
    }

    location /dumps {
        root /var/www/mediawiki/local;
        autoindex on;
    }
  location ~ /\.ht {
    deny all;
  }
      location / {
        try_files $uri $uri/ @rewrite;
    }

    location @rewrite {
            rewrite ^/([^?]*)(?:\?(.*))? /index.php?title=$1&$2 last;
    }

2、配置文件localsettings.php添加如下代码

# 静态化
$wgScriptPath = "";
$wgArticlePath = "/wiki/$1";
$wgVariantArticlePath = "/$2/$1";
$wgUsePathInfo  = true;

感谢pokewiz@欧陆风云4百科www.eu4cn.com的技术支持

标签: none

添加新评论