Wordpress multisite with subdirectories always redirects to mainsite

I have 2 wordpress-sites. Wordpress is installed under varwwwhtml with the first created site and reachable under &qu

I have 2 wordpress-sites. Wordpress is installed under /var/www/html with the first created site and reachable under "server-ip". Then I decided for a network to realize a mobile version of the site with a different theme. Now the second site is reachable under "server-ip/mobile-site/". However it doesn't matter how I log in: „server-ip/wp-admin/“ or „server-ip/mobile-seite/wp-admin/“ or „…/wp-login.php“ I almost every time end up in the dashboard of the site under "server-ip". Using two different themes for the sites does not work either, it always takes the chosen theme for both sites.

Did I messed up my wordpress-installation with creating a multisite? Can I fix this without destroying any site-content and how can I do that?

Or could it be possibly the .htaccess-file? What is the issue?

# BEGIN WordPress
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|json).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress

Thanks for the help in advance.

I have 2 wordpress-sites. Wordpress is installed under /var/www/html with the first created site and reachable under "server-ip". Then I decided for a network to realize a mobile version of the site with a different theme. Now the second site is reachable under "server-ip/mobile-site/". However it doesn't matter how I log in: „server-ip/wp-admin/“ or „server-ip/mobile-seite/wp-admin/“ or „…/wp-login.php“ I almost every time end up in the dashboard of the site under "server-ip". Using two different themes for the sites does not work either, it always takes the chosen theme for both sites.

Did I messed up my wordpress-installation with creating a multisite? Can I fix this without destroying any site-content and how can I do that?

Or could it be possibly the .htaccess-file? What is the issue?

# BEGIN WordPress
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|json).*) $1 [L]
RewriteRule ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
RewriteRule . index.php [L]
# END WordPress

Thanks for the help in advance.

Share Improve this question asked Apr 9, 2019 at 8:16 ZehkeZehke 11 bronze badge 1
  • Does the front end load okay? Have you tried this subdirectory .htaccess code? – Steve Commented Mar 10, 2022 at 7:37
Add a comment  | 

1 Answer 1

Reset to default -1

This is the .htaccess I used for multisite:

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]

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745570691a4633662.html

相关推荐

  • Wordpress multisite with subdirectories always redirects to mainsite

    I have 2 wordpress-sites. Wordpress is installed under varwwwhtml with the first created site and reachable under &qu

    22小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信