WordPress.org

Ready to get started?Download WordPress

Forums

Can't login to admin page / wp-login for subdomains (4 posts)

  1. deeppurple
    Member
    Posted 5 years ago #

    Hi,

    I install Worpress MU in http://domain.com/mu, and add 2 blogs subdomains: http://test1.domain.com and http://test2.domain.com

    I used .htaccess rules (in root of http://domain.com/) for the subdomains blogs working-start without "/mu/" folder.

    this is the .htacces rules:
    RewriteCond %{HTTP_HOST} ^test1.domain.com$ [OR]
    RewriteCond %{HTTP_HOST} ^test2.domain.com$
    RewriteRule ^(.*)$ /mu/$1 [L]

    Now the internal liks for the subdomains works fine.

    The problem is that I can't login, the first time the url admin page is:
    http://test1.domain.com/wp-login.php

    then I try to login with the correct user and password, don't show me any error message, only change the url like this:

    http://test1.domain.com/wp-login.php?redirect_to=http%3A%2F%2Ftest1.domain.com%2Fwp-admin%2F

    HOW CAN LOGIN TO A WP-ADMIN FOR SUBDOMAINS?

  2. WebDev WaxLotus LLC
    Member
    Posted 5 years ago #

    You should ask in the mu fora!

    In your .htaccess file, is there a directive that protects wp-admin.php?

    Can you log into the admin side of the primary blog? If you can, can you access the admin of child blogs from there (check dashboard tabs)?

  3. deeppurple
    Member
    Posted 5 years ago #

    ups, wrong forum.

    NO, .htaccess file doesn't have any directive that protects wp-admin.

    well, I can Login to the primary admin blog with out problems, the url is like:
    http://domain.com/mu/wp-login.php
    enter the user and password and works fine.

    but I cant login to the sub-domains :(

  4. WebDev WaxLotus LLC
    Member
    Posted 5 years ago #

    Hmm, it's been more than a year since I touched Mu, but this is what one of my .htaccess files has: edit as necessary:

    RewriteEngine On
    RewriteBase /
    
    #block .htaccess viewing
    RewriteRule ^\.htaccess$ - [F]
    
    # Prevents directory listing
    Options -Indexes
    
    # Lock WPMu out of the following subdomain directories...
    # These occur before the final rewrite of www.domain.tld to domain.tld
    # which is my preference on how the domain is branded
    
    #RewriteCond %{HTTP_HOST} forum.mydomain.org
    #RewriteCond %{REQUEST_URI} !forum/
    #RewriteRule ^(.*)$ forum/$1 [L]
    
    # Rewrite www.mydomain.org to mydomain.org with a 301
    RewriteCond %{HTTP_HOST} ^www.(.*) [NC]
    RewriteRule ^(.*) http://%1/$1 [R=301,L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ /$1/ [R=301,L]
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    #Customize Error Messages
    #ErrorDocument 400 /wp-content/error-page/400.htm
    #ErrorDocument 401 /wp-content/error-page/404.htm
    #ErrorDocument 403 /wp-content/error-page/403.htm
    #ErrorDocument 404 /wp-content/error-page/404.htm
    #ErrorDocument 500 /wp-content/error-page/500.htm
    
    <IfModule mod_security.c>
    	<Files async-upload.php>
    		SecFilterEngine Off
    		SecFilterScanPOST Off
    	</Files>
    </IfModule>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.