admin管理员组文章数量:1022864
I activated multisite using subdirectories on my old WordPress site, and I created a new site (say my-example/new-site/
).
I found links such as my-example/new-site/wp-content/mu-plugins/css/
can redirect to my-example/wp-content/mu-plugins/css/
, however, my-example/new-site/wp-content/mu-plugins/css/style.css
won't redirect and will throw out a 404 error, this leads to the site loading errors.
I was so confused, and tried hard refreshing sites, clearing cookies, but it didn't work.
The .htaccess
file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
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]
</IfModule>
# END WordPress
I activated multisite using subdirectories on my old WordPress site, and I created a new site (say my-example/new-site/
).
I found links such as my-example/new-site/wp-content/mu-plugins/css/
can redirect to my-example/wp-content/mu-plugins/css/
, however, my-example/new-site/wp-content/mu-plugins/css/style.css
won't redirect and will throw out a 404 error, this leads to the site loading errors.
I was so confused, and tried hard refreshing sites, clearing cookies, but it didn't work.
The .htaccess
file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
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]
</IfModule>
# END WordPress
Share
Improve this question
asked May 8, 2019 at 2:33
Guoyang QinGuoyang Qin
1314 bronze badges
2
|
1 Answer
Reset to default 1After trying a million of ways, I contacted the super admin and asked for permission to log into WP Engine, our host. I found there is a Multisite setting too. So I clicked "convert to multisite", and, bang! the error is resolved. Subsites can work properly now.
I activated multisite using subdirectories on my old WordPress site, and I created a new site (say my-example/new-site/
).
I found links such as my-example/new-site/wp-content/mu-plugins/css/
can redirect to my-example/wp-content/mu-plugins/css/
, however, my-example/new-site/wp-content/mu-plugins/css/style.css
won't redirect and will throw out a 404 error, this leads to the site loading errors.
I was so confused, and tried hard refreshing sites, clearing cookies, but it didn't work.
The .htaccess
file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
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]
</IfModule>
# END WordPress
I activated multisite using subdirectories on my old WordPress site, and I created a new site (say my-example/new-site/
).
I found links such as my-example/new-site/wp-content/mu-plugins/css/
can redirect to my-example/wp-content/mu-plugins/css/
, however, my-example/new-site/wp-content/mu-plugins/css/style.css
won't redirect and will throw out a 404 error, this leads to the site loading errors.
I was so confused, and tried hard refreshing sites, clearing cookies, but it didn't work.
The .htaccess
file
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
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]
</IfModule>
# END WordPress
Share
Improve this question
asked May 8, 2019 at 2:33
Guoyang QinGuoyang Qin
1314 bronze badges
2
-
"
my-example/new-site/wp-content/mu-plugins/css/
can redirect tomy-example/wp-content/mu-plugins/css/
" - I'm not sure what you mean by that? There should be no "redirect" occurring here? – MrWhite Commented May 8, 2019 at 10:53 -
1
@MrWhite According to rule
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
, the redirect will occur. – Guoyang Qin Commented May 8, 2019 at 17:53
1 Answer
Reset to default 1After trying a million of ways, I contacted the super admin and asked for permission to log into WP Engine, our host. I found there is a Multisite setting too. So I clicked "convert to multisite", and, bang! the error is resolved. Subsites can work properly now.
本文标签: htaccessWhy specific file directory fails to redirect but its parent folder succeeds
版权声明:本文标题:htaccess - Why specific file directory fails to redirect but its parent folder succeeds? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745511862a2153861.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
my-example/new-site/wp-content/mu-plugins/css/
can redirect tomy-example/wp-content/mu-plugins/css/
" - I'm not sure what you mean by that? There should be no "redirect" occurring here? – MrWhite Commented May 8, 2019 at 10:53RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
, the redirect will occur. – Guoyang Qin Commented May 8, 2019 at 17:53