对此进行了回答thread.
Summary:
这个http www/non-www的访问重定向。。。
# www redirect
RewriteCond %{HTTP_HOST} ^subdomain.com
RewriteRule ^(.*)$ http://www.subdomain.com/$1 [R=301,L]
将其置于域上的WordPress规则之上。com。应该有用。
Example:
RewriteEngine On
# DOMAIN #1 - Redirect non-www urls to www
RewriteCond %{HTTP_HOST} ^domain1.com
RewriteRule ^(.*)$ http://www.domain1.com/$1 [R=301,L]
# DOMAIN #2 - Redirect non-www urls to www
RewriteCond %{HTTP_HOST} ^domain2.com
RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]
# DOMAIN #3 ... ETC - Redirect non-www urls to www
RewriteCond %{HTTP_HOST} ^domain3.com
RewriteRule ^(.*)$ http://www.domain3.com/$1 [R=301,L]
RewriteBase /
RewriteRule ^index\\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [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]
如果有人能解释一下如何对我的每个域(如果不存在的话)强制使用尾部斜杠,那就太好了。