多站点和根主题上的.htaccess?

时间:2012-04-21 作者:3logy

我安装根主题,然后将安装转换为多站点。。。这样wordpress就可以在前面的中添加一些代码。使用根设置的htaccess。

我的htaccess现在看起来是这样的,我变成了重定向错误

我的工作中是否存在冲突。htaccess?

##### Multisite Htaccess #####
RewriteEngine On
RewriteBase /
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]

##### Multisite Htaccess end ####


# BEGIN WordPress
<IfModule mod_rewrite.c>
 RewriteEngine On   
 RewriteBase /
 RewriteRule ^index\\.php$ - [L]
 RewriteRule ^css/(.*) /wp-content/themes/roots/css/$1 [QSA,L]
 RewriteRule ^js/(.*) /wp-content/themes/roots/js/$1 [QSA,L]
 RewriteRule ^img/(.*) /wp-content/themes/roots/img/$1 [QSA,L]
 RewriteRule ^plugins/(.*) /wp-content/plugins/$1 [QSA,L]
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]
</IfModule>

# END WordPress

1 个回复
最合适的回答,由SO网友:Nasir 整理而成

嗯,我有根和多站点。但是,我没有特定于根的重写规则。

我在docs. 我将其用于子域而不是子文件夹。

RewriteEngine On
RewriteBase /
RewriteRule ^index\\.php$ - [L]

# uploaded files
RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule . index.php [L]
把它们和你的相比,也许底部的方块是额外的?

结束

相关推荐

将/CATEGORY/CARS重写为/Themes/Cars

我知道有很多关于这方面的问题和帖子,但是我找不到一个解决方案或我的特定问题的现有线索。如果我列出我的类别并单击“cars”,url如下所示url/category/cars是否可以在函数中使用某些函数。php更改单词category 进入,进入。topicsurl/topics/cars 有什么想法吗?提前感谢您!