Apps on different subdomains

  • Affected Version
    WoltLab Suite 3.0

    Hey there,


    I have bought a license with the Forum, Filebase and Gallery included. I have installed all of the apps in the same directory in their respective directories and am now trying to set it up so that the different apps are on their own subdomains as follows:

    • Forum: forum.domain.com
    • Filebase: downloads.domain.com
    • Gallery: gallery.domain.com


    I have managed to get this setup, however if I login on, for example, forum.domain.com and then head over to the filebase, I will have to login again at the filebase. I presume this is a cookies related issue.


    Additionally, I suspect that my friendly URLs rewrite rules are messing up the login process, as if I attempt to login on the Filebase/Gallery I get the following error message:


    [Blocked Image: http://i.imgur.com/mpCF9SP.png]



    Is anybody able to help with getting these issues resolved?


    Cheers,

    Tom

  • Sounds like a bad cookie domain, what have you set for each app? Also if you've logged-in before moving the apps around, please make sure to whipe the cookies for that domain, otherwise browsers will randomly pick a cookie.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • Sounds like a bad cookie domain, what have you set for each app? Also if you've logged-in before moving the apps around, please make sure to whipe the cookies for that domain, otherwise browsers will randomly pick a cookie.

    Ahh, that was the issue. Just needed to clear my browser's cookies and it worked fine. Thanks :)

  • It appears to me that the apps are installed in directories below the subdomain, so instead of forum.example.com/, the forum is actually installed in forum.example.com/forum/? Did you by any chance not move the apps to the root of the subdomain or did not set the application path to /?

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • It appears to me that the apps are installed in directories below the subdomain, so instead of forum.example.com/, the forum is actually installed in forum.example.com/forum/? Did you by any chance not move the apps to the root of the subdomain or did not set the application path to /?

    I have it setup so that all of the apps are in the same directory, using domain aliases. It seemed to be working fine until I ran the latest updates.


    So, WFC is installed in/, whilst the forums are installed in /forums, for example.

  • Uh, I'm not quite sure how the aliases work with your control panel software, but the document root of each subdomain should point directly to the installation directories themselves. You may want to consider reaching out to your hosting company and ask them for assistance.


    Lets assume that your directory structure looks like this:

    Code
    /var/www/customer/htdocs/ -> example.com
    /var/www/customer/htdocs/forum/ -> example.com/forum/
    /var/www/customer/htdocs/foo/ -> example.com/foo/

    Then your domains should be configured to map to these paths:

    Code
    www.example.com -> /var/www/customer/htdocs/
    forum.example.com -> /var/www/customer/htdocs/forum/
    foo.example.com -> /var/www/customer/htdocs/foo/

    The application path as set in the admin panel should be / for each.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • Make sure each subdomain has a .httaccess file configured for url rewrite when using Apache servers. This information is located in the help guide: https://www.woltlab.com/articl…ng-up-user-friendly-urls/


    My Test:

    So since my site is relatively new I went ahead and tested the configuration that Tom is talking about.


    Site installed in root directory / using a normal installation method.

    Forum is in /forum/

    Calendar is in /calendar/

    Blog is in /blog/

    Configured URL-rewrite and adjusted the .httaccess


    Next I I mapped sub domains to each of the directories

    testsite.com -> /

    forum.testsite.com -> /forum/

    blog.testsite.com -> /blog/

    calender.testsite.com -> /calendar/


    I went into the ACP /Configuration/Packages/Manage Apps

    Left the WoltLab Suite Core at testsite.com pointing to / (root) where I originally installed it with the cookie still being directed to testsite.com.

    Changed WoltLab Suite Forums (Burning Board) domain to forum.testesite.com, path to / and left cookies set to testsite.com.

    Changed WoltLab Suite Calendar domain to calendar.testesite.com, path to / and left cookies set to testsite.com.

    Changed WoltLab Suite Blog domain to blog.testesite.com, path to / and left cookies set to testsite.com.


    Testing the forums:

    When I click on the link for forums, blog, or calendar they all pull up the appropriate page. Once I click on a link that would take me into a post though that is when everything goes wrong.

    When entering the entrance forum:

    Forms come up with a URL of forum.testsite.com/board/2-entrance/ (which gave me a 500 internal server error).

    This was due to url-rewrite being enabled but only having the .httaccess file in the root directory and not each of the subdomain root directories. So if your going to use sub domains to map to each of the APPS in woltlab and you enable url-rewrite, then you need to make sure all the subdomain root directories have the .httaccess file.


    Friendly URL or URL-REWRITE

    Add the following code to the .httaccess file in each domain/subdomain


    Apache Configuration
    # BEGIN WOLTLAB
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?$1 [L,QSA]
    </IfModule>
    # END WOLTLAB