[resolved] Subdomains keep redirecting to mainsite (2 posts)

  1. genughaben
    Posted 2 years ago #

    Dear all,

    although I kept searching and already found many threads with comparable problem descriptions I could not figure out yet what goes wrong in my case.

    I installed a fresh WP 3.5.1 with Multisite Option using WP MU Domain Mapping in the root folder of my server.
    I use the subfolder-option for multisites. I also tried using the subdomain-option - which did not make any differen: I got the same error.
    As long I do not use any other domains everything works fine.

    I have my mainsite (1) and my subfolder-site (2)
    1: domain1.de
    2: domain1.de/subsite

    When I now add another domain2.de (pointing to domain1.de on the cpanel of my host) and mapped on domain1.de/subsite I cannot enter my subsite. I also cannot even enter the subsites admin-panel any more.
    As soon I make the mapping entry "no primary" I can enter the subsite again but do not see the wished domain2.de as url but domain1.de/subsite again.

    Content of my wp-config.php

    define('MULTISITE', true);
    define('SUBDOMAIN_INSTALL', false);
    define('DOMAIN_CURRENT_SITE', 'genughaben.de');
    define('PATH_CURRENT_SITE', '/');
    define('SITE_ID_CURRENT_SITE', 1);
    define('BLOG_ID_CURRENT_SITE', 1);

    Content of my .htaccess

    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]

    content of my 000-default (in apache2/sites-enabled):

    <VirtualHost*:80>                                                              ServerAdmin webmaster@localhost
            ServerName domain1.de
            ServerAlias *.domain1.de
            ServerAlias www.domain1.de
    	ServerAlias *.domain2.de
            ServerAlias www.domain2.de
            DocumentRoot /var/www/
            <Directory />
                 Options FollowSymLinks
                 AllowOverride all
            <Directory /var/www/>
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride all
                  Order allow,deny
                  allow from all
            ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
            ErrorLog /var/log/apache2/error.log 
         # Possible values include: debug, info, notice, warn, error, crit,
         # alert, emerg.
            LogLevel warn
            CustomLog /var/log/apache2/access.log combined
            Alias /doc/ "/usr/share/doc/"
            ProxyRequests Off
            ProxyPass /olat/ http://localhost:8080/olat/
            ProxyPassReverse /olat/ http://localhost:8080/olat/
            <Location "/olat/">
                    Order allow,deny
                    Allow from all

    I do not now whether this is of further importance but :
    - I am using an ubuntu clound server.
    - And another thing I stumpled upon in another thread if I walk in the super admin panel in "settings->domains" I happen to have only one entry for domain2.de with id2.

    Very happy to hear suggestions from anybody :)

    Kind regards

  2. genughaben
    Posted 2 years ago #

    I found the solution on my own: I had to add a wildcard A-Record to my IP adress and I also had a problem with domain-mapping.php residing in mu-plugins AND plugins folder - it should only reside in plugins (in my case).

    Kind regards

Topic Closed

This topic has been closed to new replies.

About this Topic