Forums

[resolved] Multiple Blogs without wildcard DNS (2 posts)

  1. lohray
    Member
    Posted 1 year ago #

    Hi,

    I am trying to setup multiple subdomains to be able to access a single WP installation. However, I would like to have my users have their separate sets of folders too.

    If I put in a wild card serverAlias in the apache httpd virtual host section, all subdomains (each belonging to a different user) shall share a common DocumentRoot (undesirable). Is there a way to get around this?

    What I tried on my domain tree:

    domain.com/wpress ->The actual Installation (Blog 1)
    user1.domain.com/wpress -> A subdomain installation (Blog 2)
    user2.domain.com -> (Blog 3) Note there is no /wpress folder.

    Here, the DocumentRoot of user2 is a symbolic link to domain.com/wpress. Logging in causes it look for user2.domain.com/wpress/wp-admin although the blog renders at user2.domain.com

    This led me to create another symbolic link called wpress in the wpress folder linking it to itself. Things either ended up with a 500 error or an infinite loop of login forms.

    Does anyone have any suggestions to achieve the desired effect (keep user spaces separate) ?

  2. lohray
    Member
    Posted 1 year ago #

    I got it!

    The main installation is at http://domain.com/weblog

    I do not follow the codex to the letter and create a virtual directory section without a wildcard. Now I have a subdomain http://user1.domain.com/ that does not hare the document root with the main WP installation.

    To get WP working:

    1. Create a symbolic link in the DocumentRoot of user1.domain.com to the installation directory.

    Place the following .htaccess file in the document root of user1.domain.com

    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-admin(.*)$ weblog/wp-admin$1 [R=301,L]
    RewriteRule ^(.+)$ /weblog/$1 [L]
    RewriteRule ^(.?)$ /weblog/$1 [L]

    Things seem to be working so far without any problems logging in.

Topic Closed

This topic has been closed to new replies.

About this Topic