为什么再百度 nignx 下配置的 wordpress 多站点模式下。。。访问不了子站点的首页和仪表盘

为什么再百度 nignx 下配置的 wordpress 多站点模式下。。。访问不了子站点的首页和仪表盘


正在查看 5 个帖子:1-5 (共 5 个帖子)
  • 作者
    帖子
  • 364501079
    • 文章数量: 52
    @364501079
    楼主

    进入不了后台登录界面

    读取不了css

    诗语
    管理员
    • 文章数量: 5,866
    @feibisi

    为什么再百度nignx下配置的wordpress多站点模式下。。。访问不了子站点的首页和仪表盘

    没明白也没看到你这段话是啥意思,请详细描述问题和你的操作方式。

    多打几个字花不了你多少时间。

    364501079
    • 文章数量: 52
    @364501079
    楼主

    新建的子站点。。都是打不开的。。

    我的按照伪静态配置

    我猜是伪静态的问题导致出现访问不了

    我要是修改成

    server {
    listen 80;
    server_name smartbpm.cn *.smartbpm.cn
    
    index index.html index.htm index.php;
    root /home/bae/app;
    
    location ~ [^/]\.php(/|$) {
    #fastcgi_pass remote_php_ip:9000;
    fastcgi_pass unix:/dev/shm/php-cgi.sock;
    fastcgi_index index.php;
    include fastcgi.conf;
    }
    location / {
    index index.php;
    try_files $uri $uri/ /index.php?$args;
    }
    
    # Add trailing slash to */wp-admin requests.
    rewrite /wp-admin$ $scheme://$host$uri/ permanent;
    
    # Directives to send expires headers and turn off 404 error logging.
    location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
    expires 24h;
    log_not_found off;
    }
    
    # this prevents hidden files (beginning with a period) from being served
    location ~ /\. { access_log off; log_not_found off; deny all; }
    
    # Pass uploaded files to wp-includes/ms-files.php.
    rewrite /files/$ /index.php last;
    
    if ($uri !~ wp-content/plugins) {
    rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;
    }
    
    # Rewrite multisite '.../wp-.*' and '.../*.php'.
    if (!-e $request_filename) {
    rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
    rewrite ^/[_0-9a-zA-Z-]+.*(/wp-admin/.*\.php)$ $1 last;
    rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
    }
    
    }

    这个的话就会一直出现

    诗语
    管理员
    • 文章数量: 5,866
    @feibisi

    那就是你伪静态有问题,server_name smartbpm.cn *.smartbpm.cn 你这是泛解析的,没有写子目录的。

    这个试一下。

    rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
    if (!-e $request_filename){
    	rewrite ^.+?(/wp-.*) $1 last;
    	rewrite ^.+?(/.*\.php)$ $1 last;
    	rewrite ^ /index.php last;
    }
    364501079
    • 文章数量: 52
    @364501079
    楼主

    谢谢了,处理好了。

    百度云单用户伪静态处理用这个,在bcloud_nginx_user.conf

    if (-f $request_filename/index.html){
    rewrite (.*) $1/index.html break;
    }
    if (-f $request_filename/index.php){
    rewrite (.*) $1/index.php;
    }
    if (!-f $request_filename){
    rewrite (.*) /index.php;
    }

    多用户的bcloud_nginx_user.conf用下面的


    rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last; if (!-e $request_filename){ rewrite ^.+?(/wp-.*) $1 last; rewrite ^.+?(/.*\.php)$ $1 last; rewrite ^ /index.php last; }

正在查看 5 个帖子:1-5 (共 5 个帖子)
  • 哎呀,回复话题必需登录。

未找到对应子版块?请直接在 [疑难杂症] 版块中发帖提问。

收藏纪念品


有奖活动

参与论坛社区问答,有机会获赠文派瓦普(Wapuu.com)手办模型。

话题信息

商业系统