MediaWiki 图片显示正常。但点击图片打开链接 404 了? - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
dxhuii
V2EX    Wikipedia

MediaWiki 图片显示正常。但点击图片打开链接 404 了?

  •  
  •   dxhuii 2015-04-22 19:16:36 +08:00 5004 次点击
    这是一个创建于 3826 天前的主题,其中的信息可能已经有所发展或是发生改变。

    http://www.99496.com/wiki/文件:9ad6aaed513b7318b7d49f70afcfb32.jpg 这样会404 是什么问题,打开地址是这样的,看到别人家的,这样打开是能打开图片的。我这个是哪里配置不对吗?第一次用这个程序。

    第 1 条附言    2015-04-23 14:43:21 +08:00
    刚刚把wiki 换成了baike 以前安装目录和伪静态目录一样,以为是这个问题,但换了之后,还是不行,还是404,不知道错在哪里,目前就发现在图片不能显示外,其他都正常。
    6 条回复    2015-04-23 16:10:16 +08:00
    Koell
        1
    Koell  
       2015-04-22 20:13:57 +08:00
    大概是伪静态配置问题。
    http://www.99496.com/wiki/index.php?title=%E6%96%87%E4%BB%B6:9ad6aaed513b73148b7d49f70afcfb32.jpg
    好久没配置mw了不清楚。
    dxhuii
        2
    dxhuii  
    OP
       2015-04-23 13:54:02 +08:00
    @Koell 那 NGINX的伪静态规则是什么样的?
    dxhuii
        3
    dxhuii  
    OP
       2015-04-23 13:58:59 +08:00
    @Koell 我也是第一次用。从网络上找到的伪静态规则。发出来你看一下。还缺什么:if (!-e $request_filename){
    rewrite ^/wiki/(.*)$ /wiki/index.php?title=$1&$args;
    }
    dxhuii
        4
    dxhuii  
    OP
       2015-04-23 13:59:59 +08:00
    @Koell 我也是第一次用。从网络上找到的伪静态规则。发出来你看一下。还缺什么:

    if (!-e $request_filename){
    rewrite ^/wiki/(.*)$ /wiki/index.php?title=$1&$args;
    }
    Koell
        5
    Koell  
       2015-04-23 14:55:17 +08:00
    @dxhuii 渣渣没配置过nginx,不过把if (!-e $request_filename) { }去掉试试?这个是判断文件是否存在的。
    再多的就帮不了了,抱歉。
    dxhuii
        6
    dxhuii  
    OP
       2015-04-23 16:10:16 +08:00
    @Koell

    location / {
    if (!-e $request_filename) {
    rewrite ^/baike/(.*)$ /wiki/index.php?title=$1&$args;
    }
    }

    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    try_files $uri /wiki/index.php;
    expires max;
    log_not_found off;
    }
    # Restrictions based on the .htaccess files
    location ^~ ^/(cache|ncludes|maintenance|languages|serialized|tests|images/deleted)/ {
    deny all;
    }
    location ^~ ^/(bin|docs|extensions|includes|maintenance|mw-config|resources|serialized|tests)/ {
    internal;
    }
    location ^~ /images/ {
    try_files $uri /wiki/index.php;
    }
    location ~ /\. {
    access_log off;
    log_not_found off;
    deny all;
    }


    这样就好了,我也不知道为什么就好了。图片就可以打开了。

    换了目录: http://www.99496.com/baike/文件:9ad6aaed513b73148b7d49f70afcfb32.jpg
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2477 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 20ms UTC 15:29 PVG 23:29 LAX 08:29 JFK 11:29
    Do have faith in what you're doing.
    ubao snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86