We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36467
    • 73 Posts
    www.amitpatil.me Reply #1, 15 years ago
    Hello MODx developers,

    I am using MODx revolution. I have just transferred site from one domain to another. as it was a IP based server i have created virtual host with the same name it had previously.
    On previous server the files were located at the root but in new server files are located at tab3, so i have created virtual host that points inside that directory. ie. I have all files in modx/ dir so my virtual host config set to /var/www/modx/
    Now the problem is whenever i open home page as well as subdomains (contexts) it works and shows the page but when i open any internal links it says 404 page
    Ex : if i open www.abc.com => It works
    but when i open www.abc.com/contacts => It doesnt works

    I see its issue with .htaccess because
    1) if i remove htaccess
    all the subdomains and domains works perfect but inner links like "abc.com/contact" doesnt open up and says 404
    2) If i add it again only the main domain and its inner links open...no subdomain or inner links of subdomain works

    DO i need to add/remove something from htaccess ??
    [ed. note: amitpatil last edited this post 14 years, 2 months ago.]
      • 36467
      • 73 Posts
      www.amitpatil.me Reply #2, 15 years ago
      Forgot to mention that when i try to access same 404 page with id like
      http://www.abt.com/index.php?id=8056

      It works
        • 3749
        • 24,544 Posts
        Make sure you have this in the <head> section of all your templates:

        <base href="[[!++site_url]]" />


        And make sure that you have a context setting for each context with the correct settings for these:

        site_url
        base_url
        http_host
          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
          • 36467
          • 73 Posts
          www.amitpatil.me Reply #4, 15 years ago
          yes its there....and i have settings for site_url, base_url and http_host too
          i also checked .htaccess file its also same as provided in setup
            • 27708 MODX Staff
            • 2,502 Posts
            Did you set these:

            site_url
            base_url
            http_host

            for the Web context? From what I understand it too must be edited when using subdomains.
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
              • 36467
              • 73 Posts
              www.amitpatil.me Reply #6, 15 years ago
              @Bob and @jay : That was the problem....its wroking now.

              Many thanks guys for helping out.
                • 3749
                • 24,544 Posts
                I'm glad you got it sorted. Thanks for reporting back. smiley
                  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