WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. genughaben
    Member
    Posted 9 months 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 0.5.4.3 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>
    
            <Directory /var/www/>
                  Options Indexes FollowSymLinks MultiViews
                  AllowOverride all
                  Order allow,deny
                  allow from all
            </Directory>
    
            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
            </Location>
    </VirtualHost>

    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
    Frank

  2. genughaben
    Member
    Posted 9 months 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
    Frank

Reply

You must log in to post.

About this Topic