我在本地主机的子目录中设置多站点。
问题是,当我试图访问我刚刚创build的网站的仪表板(本地主机/ wptest /网站/ wp-admin),我得到“这个网页有一个redirect循环” ,当我尝试访问实际的网站localhost / wptest / site)页面加载但没有资产,如CSS。
当我访问networking仪表板或localhost / wptest上的主站点仪表板时,一切都很好。 另外当我编辑在networking仪表板的第二个网站的永久链接,就像这样:本地主机/网站它也运行良好。
如何使它与默认的永久链接结构localhost / wptest / site?
wordpress文件在
/usr/share/html/wptest
wp-config.php如下:
define('WP_ALLOW_MULTISITE', true); define('MULTISITE', true); define('SUBDOMAIN_INSTALL', false); define('DOMAIN_CURRENT_SITE', 'localhost'); define('PATH_CURRENT_SITE', '/wptest/'); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1);
而服务器块/虚拟主机是这样的:
server { ##DM - uncomment following line for domain mapping listen 80 default_server; #server_name example.com *.example.com ; ##DM - uncomment following line for domain mapping #server_name_in_redirect off; access_log /var/log/nginx/example.com.access.log; error_log /var/log/nginx/example.com.error.log; root /usr/share/nginx/html/wptest; index index.html index.htm index.php; if (!-e $request_filename) { rewrite /wp-admin$ $scheme://$host$uri/ permanent; rewrite ^(/[^/]+)?(/wp-.*) $2 last; rewrite ^(/[^/]+)?(/.*\.php) $2 last; } location / { try_files $uri $uri/ /index.php?$args ; } location ~ \.php$ { try_files $uri /index.php; include fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; } location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; } location = /robots.txt { access_log off; log_not_found off; } location ~ /\. { deny all; access_log off; log_not_found off; } }
最后这是一个错误日志:
2013/06/29 08:05:37 [error] 4056#0: *52 rewrite or internal redirection cycle while internally redirecting to "/index.php", client: 127.0.0.1, server: example.com, request: "GET /nginx HTTP/1.1", host: "localhost"
试试这个 – http://rtcamp.com/wordpress-nginx/tutorials/multisite/subdirectories/in-a-subdirectory/
你只需要调整几行。 在上面的URL中用wptestreplacewordpress中的configuration。
除此之外,你可能需要一些小的调整。 让我知道事情的后续!