WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] local sub-domain multisite login problem ?????!! (8 posts)

  1. Nikos M.
    Member
    Posted 2 years ago #

    hi ,all
    i have a multisite install locally on xampp
    i have setup wordpress with wp-config.php (allow_multisite, multiaite, etc..), virtual hosts in apache

    </VirtualHost>
    NameVirtualHost *.domain.com
    <VirtualHost *:80>
    	ServerAdmin webmaster@localhost
    	DocumentRoot C:/domain
    	ServerName domain.com
    	ServerAlias *.domain.com
    	<Directory "C:/domain">
        Options Indexes FollowSymLinks Includes ExecCGI
    
        AllowOverride All
        Order allow,deny
        Allow from all
    
    	</Directory>
    </VirtualHost>

    setup hosts in win hosts file

    127.0.0.1 en.domain.com
    127.0.0.1 el.domain.com
    127.0.0.1 ar.domain.com

    created the sub domain sites through network admin
    and i can view all frontends
    the problem is that i can login only to primary site

    when i try to login to other sites
    although the login is succesfull (no error)
    it cannot redirect to admin section and redirects back to login page
    (cookies not set right) example:
    http://ar.domain.com/wp-login.php?redirect_to=http%3A%2F%2Far.domain.com%2Fwp-admin%2F&reauth=1
    how can this be fixed??

    thanx

  2. sebicas
    Member
    Posted 2 years ago #

    I have the same problem with a brand new 3.3.1 install... please help!

  3. xitmo
    Member
    Posted 2 years ago #

    I have also the same problem! waiting for help!

  4. Nikos M.
    Member
    Posted 2 years ago #

    Actually i solved the problem (it wasnt a real problem i think) you just have to have the main site of the multisite hav the root url

    my problem was that i wanted to have all sub-sites of multisite as sub-domains eg. en.domain.com, el.domain.com etc
    this is wrong (this is right but for wordpress is wrong) the main (first) sub site has to have the root url ie domain.com

    This was my problem, of course you also have to setup your vistual hosts correctly in XAMPP or Apache and define server alias in virtual host entry as

    ServerAlias domain.com *.domain.com

    Also you have to setup the hosts file (if local) on your local machine

    Hope this helps

  5. xitmo
    Member
    Posted 2 years ago #

    Thank you for your fast answer. In my case the root folder of my webpage is already in use, so I wanted blog.domain.com and blog2.domain.com etc., now i have seen that this setup is not supported by the native wordpress network!
    An interessting discussion on this subject is here:
    http://wordpress.org/support/topic/using-subdomains-with-all-blogs-at-the-third-domain-level?replies=20

  6. Nikos M.
    Member
    Posted 2 years ago #

    It is relatively easy to alter wordpress core to have this functionality
    i think it's not more than 3 lines of code
    but you would have changed the wordpress core with all consequences (no update etc..)

  7. xitmo
    Member
    Posted 2 years ago #

    That would be too much for me, I'm not an wordpress expert, just stubborn and overambitious, I will try next the domain mapping plugin!

  8. Nikos M.
    Member
    Posted 2 years ago #

    The domain mapping plugin is when you want to map the subdomains to different urls but still they have to be created in the first placce as wordpress wants them.
    im not sure but maybe it will work
    Try it and post back here your experience for everyone else to see.

Topic Closed

This topic has been closed to new replies.

About this Topic