We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26334
    • 77 Posts
    Sorry if this question has been answered, can’t find it for searching however.

    I have noticed that a user that logs into their modx account at say:

    http://www.mydomain.com

    and then goes to the domain without the www’s

    http://mydomain.com

    They are logged out. They have to log back in, or goto the www.mydomain.com and they are still logged in. Seems the cookie doesn’t follow them between www.mydomain.com and mydomain.com

    I know this is an apache config (aliasing both so either work).

    Question is how do I get the login to follow them if they flick between alias’s?

    If I can’t do that, what is the best solution? I would prefer not to have the www’s at all and have everything just direct to
    http://mydomain.com

    Server is apache,
    os is Debian Linux,
    modx is 0.9.6.1p2
    domain management is plesk

    Thanks.
      • 3749
      • 24,544 Posts
      Look in the .htaccess file in the root MODx directory (the one that contains the manager directory). Rename it from ht.access to .htaccess if necessary. It has code that you can uncomment to redirect www to no-www.

      BTW, how are the user’s getting to the other URL from links in your site? Are you using [~nn~] for all your links?

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 26334
        • 77 Posts
        Thanks.

        The website has been around since 1995 and people have it bookmarked, have thousands of links in etc or they just type in www.ski.com.au

        It worked and then everything stayed at www.ski.com.au instead of ski.com.au

        However since we have several subdomains and use kickapps for aspects of our community and have separate forum software and classifieds software invariably they would switch at some stage between www.ski and ski and that is when the problems would start.

        Sorted now. Much appreciated.