VPS侦探论坛

 找回密码
 注册
查看: 4346|回复: 1

关于rewrite造成微信分享404页面问题

[复制链接]
发表于 2015-12-9 11:05:36 | 显示全部楼层 |阅读模式

今日发现微信分享的时候,会给分享链接带上?from=timeline&isappinstalled=0   造成分享的页面全部404问题。
比如我打开http://www.abc.com?from=timeline&isappinstalled=0  会报404问题。而正常网站都可以访问,比如
http://www.baidu.com?from=timeline&isappinstalled=0  是可以正常访问的。

附带我的nginx conf配置。请大神帮找下病症我的rewrite哪里出问题了。

不想有广告嫌疑,故把域名用abc.com代替了

server
    {
        listen 80;
        server_name www.abc.com abc.com;
        index index.php index.html index.htm home.php default.html default.htm default.php;
        root  /home/wwwroot/abc.com;
        if ( $host ~ "^abc\.com$") {
                  rewrite ^/(.*) http://www.abc.com/$1 permanent;
              }

     location /
     {

         if ($request_uri ~* ^/system)
         {
             rewrite ^/$ /index.php?/$1 last;
             break;
         }




         if (!-e $request_filename)
         {
             rewrite ^/$ /index.php?/$1 last;
             break;
         }




         error_page 404 /index.php;




         location ~ /\.ht
         {
             deny all;
         }






                 location ~ [^/]\.php(/|$)
        {
            # comment try_files $uri =404; to enable pathinfo
            try_files $uri =404;
            fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_index index.php;
            include fastcgi.conf;
            #include pathinfo.conf;
        }



         location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
         {
             if (-f $request_filename) {
                 expires      30d;
                 break;
             }
         }


         location ~ .*\.(js|css)?$
         {
            if (-f $request_filename) {
                 expires      12h;
                 break;
             }
         }

     }

}
熟悉rewrite的朋友帮看下这个 是不是不完善造成的。
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2015-12-9 16:38:53 | 显示全部楼层


不大可能报404 ,你这404 都指向index.php了,index.php 不存在的话是报403

另外你这伪静态写真是无力吐槽
还是找你程序开发方弄一个吧
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-28 15:21 , Processed in 0.025657 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表