為什麼再百度 nignx 下配置的 wordpress 多站點模式下。。。訪問不了子站點的首頁和儀表盤

正在查看 5 個帖子:1-5 (共 5 個帖子)
  • 作者
    帖子
  • 364501079
    • 文章數量: 52
    @364501079
    樓主

    進入不了後台登錄界面

    讀取不了css

    詩語
    管理員
    • 文章數量: 5,925
    @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,925
    @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 個帖子)
  • 哎呀,回覆話題必需登錄。

話題信息

  • 當前位於:WordPress Multisite
  • 4 條回覆
  • 2 個參與人
  • 最後回覆:<a href="https://bbs.weixiaoduo.com/users/364501079/" title=" 查看 364501079 的個人資料" class="bbp-author-link"><span class="bbp-author-name">364501079</span></a>
  • 上次活動:<a href="https://bbs.weixiaoduo.com/topic/27971/#post-27985" title=" 回覆至:為什麼再百度 nignx 下配置的 wordpress 多站點模式下。。。訪問不了子站點的首頁和儀表盤">6 年、 6 月前</a>