We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42465
    • 33 Posts
    I have a slight problem on a site I'm currently working on. I can't access the manager and I believe that this is because of a conflict between the site url and the htaccess file. The login form doesn't submit and the page stays as it is without an error message. When I click on the login button in Firebug I see a 301 redirect message.

    As it stands the Site url is mysite.com. And the htaccess file is as follows:

    RewriteCond %{HTTP_HOST} !^www.mysite.com$ [NC]
    RewriteRule ^(.*)$ http://www.mysite.com/$1 [L,R=301]

    If I comment out the above redirects I can access the manager but this defeats the purpose of the redirects. What I *think* need to do is change the site url for non-www to www.

    Dumb question - but how in Evo do you set the site url? I've checked index.php, manager/indexphp, config.inc.php the manger system settings and even searched the database for all instances of mysite.com. Nothing obvious. I've spent a fair bit of time looking for an answer but noting. Perhaps it's so obvious that no one needs to ask.

    [ed. note: bob-rooney last edited this post 13 years, 1 month ago.]
      • 40092
      • 265 Posts
      You can set the site url in the config.inc.php file. Wich resides in /manager/includes.

        • 16551 ☆ A M B ☆
        • 54 Posts
        There should also be a file /manager/ht.access
        Try renaming this to .htaccess as this disables rewriting rules for the manager.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Don't mess with the automatically detected site_url.

          The problem is that your login form is on domain.com, while once you log in it accesses www.domain.com (or perhaps vice versa). For SESSION purposes, domain.com and www.domain.com are two different domains. Technically www.domain.com is a subdomain of domain.com.

          The .htaccess rewrites don't have any effect on the /manager/ directory. See the line
          RewriteRule ^(manager|assets|js|css|images|img)/.*$ - [L]

          What you need to do is decide which domain you want to use, domain.com or www.domain.com and uncomment the appropriate lines in the .htaccess file. Also, check your DNS records to make sure that www.domain.com is a CNAME record pointing to either domain.com or the IP address for domain.com.

          Then access the login form with the domain or subdomain you've chosen to use. Check the URLs in the address bar to make sure you're getting the same one. Once you're logged in, be sure to clear the cache and make a change to the system settings so that cache will also be cleared. You can manually empty the /assets/cache/siteCache.idx.php file if you want to; MODx will re-generate it.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 42465
            • 33 Posts
            Cheers Susan. I'll give that a try.