我在以下教程中实现了WP multisite的嵌套路径:http://maisonbisson.com/blog/post/14052/wordpress-hacks-nested-paths-for-wpmu-blogs/
几乎90%的任务都已实现,但我需要在RewriteRule方面得到帮助。htaccess文件。
以下是我目前的状态。htaccess文件:
RewriteEngine On
RewriteBase /james/
RewriteRule ^index\\.php$ - [L]
# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [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).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\\.php)$ $1 [L]
RewriteRule . index.php [L]
我无法在中重写样式表、JS和图像路径。htaccess,我尝试了多种规则,我尝试了替换:
RewriteRule ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
使用:
RewriteRule ^([_0-9a-zA-Z-]+/)+(wp-(content|admin|includes).*) $2 [L]
但这只会有助于使图像为slider的默认2010主题工作。
我正在编写:WordPress版本3.4.2