本文介绍了为Nginx重写Wordpress 3.0(多站点)的规则吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是wordpress正在使用的新版本...

This is the new version being used by wordpress...

RewriteEngine On
RewriteBase BASE/

#uploaded files
RewriteRule ^(.*/)?files/$ index.php [L]
RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]

# add a trailing slash to /wp-admin
RewriteCond %{REQUEST_URI} ^.*/wp-admin$
RewriteRule ^(.+)$ $1/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

在Nginx中会是什么样?

What would it look like in Nginx?

推荐答案

这取决于您要如何使用WordPress Multisite.

It depends how do you want to use WordPress Multisite.

对于具有子域的多站点- http://rtcamp.com/教程/nginx-wordpress-multisite-subdomains-domain-mapping/

For Multisite with Subdomain - http://rtcamp.com/tutorials/nginx-wordpress-multisite-subdomains-domain-mapping/

对于带有子目录的多站点- http://rtcamp.com/教程/wordpress-nginx-multisite-subdirectories-nginx-map/

For Multisite with Subdirectory - http://rtcamp.com/tutorials/wordpress-nginx-multisite-subdirectories-nginx-map/

您将需要根据计划使用的缓存插件/机制添加更多规则. (参考)

You will need to add some more rules depending on which cache plugin/mechanism you plan to use. (ref)

这篇关于为Nginx重写Wordpress 3.0(多站点)的规则吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 06:34