• Often, when I attempt to go the administrative page for a subdomain, e.g., /wp-admin, I get redirected to the main site’s wp-admin instead. What might cause this? Is this happening at the apache level or the WP level?

    Here is my redirect configuration (from Apache’s config; there is no .htaccess file):
    <Directory />
    RewriteRule ^index\.php$ – [L]
    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
    RewriteRule ^(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    </Directory>

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    It’s WP, not Apache. Apache always sends all requests to the main site. WP then checks the requested subdomain and handles the request accordingly.

    I’ve not noticed such behavior on my network but it may be due to it being sub-directory based. I think what’s happening is WP sends you to the admin area of the first site it finds in which you are admin regardless of the origin of the login page. When you login to a sub-site, it’s really the main site’s login page. Maybe WP sends you to where it thinks you belong regardless of how you logged in? IDK. I mainly wanted to confirm it’s not Apache since no one else was answering. I cannot definitively explain what WP is doing.

Viewing 1 replies (of 1 total)
  • The topic ‘Why does subdomain wp-admin redirect to the top-level’ is closed to new replies.