We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39399
    • 4 Posts
    Hi Everyone,

    I'm very new to Modx so sorry if I ask any obvious questions.

    Here is my problem:

    I have a modx site installed in a subdirectory of an existing site for testing and hosting purposes, for example my website might be www.mywebsite.com and my modx site might be www.mywebsite.com/mymodxwebsite. Everything worked fine and then I decided to purchase a domain name (www.mymodxsite.com for example) and have it point to the subdirectory (www.mywebsite.com/mymodxwebsite) where my modx wesbite is installed and hosted.

    When I try to login to the manager from my new domain (www.mymodxsite.com/manager) the manager login page doesn't display correctly, almost like it can't find the css file. And I'm unable to login. The website itself works fine except for my galleries (using gallery for modx) because gallery is pointing to the wrong location.

    If I go www.mywebsite.com/mymodxwebsite/manager it is fine and the website works like it should.

    Does anyone have any suggestions?

    Thank you!
      • 10208 ☆ A M B ☆
      • 1,780 Posts
      In the root folder (above your site folder) you'll need an .htaccess file with the following code:

      <IfModule mod_rewrite.c>
      RewriteEngine On
      
      RewriteRule ^manager$ /yourSubFolder/manager/ [R=301,L]
      RewriteCond %{HTTP_HOST} ^yourSubFolder\.com$ [OR]
      RewriteCond %{HTTP_HOST} ^www\yourRootFolder\.com$
      RewriteCond %{REQUEST_URI} !^/yourSubFolder/
      RewriteRule (.*) /yourSubFolder/$1
      </IfModule>
      


      I also have this in my .htaccess, you may or may not need it depending on your host and where the php.ini file is located.

      <IfModule mod_suphp.c>
       suPHP_ConfigPath /home/mySubFolder
       <Files php.ini>
         order allow,deny
         deny from all
       </Files>
      </IfModule>


      In the sub folder where your MODX site is installed you'll need another .htaccess file with this code:

      RewriteEngine On
      RewriteBase /yourSubFolder
      
      
      



      This works well until you pass beyond the home page on the sub folder's site and then the sub folder shows up in the url. I haven't figured out how to fix that just yet.

        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 39399
        • 4 Posts
        Great, its working now.

        Thank you very much!!
          • 39025
          • 21 Posts
          Frogabog I have the exact same situation, my problem is we have 3 sub-folders with 3 separate installations of modx, how would you address for each site individually?
            • 10208 ☆ A M B ☆
            • 1,780 Posts
            Susan Sottwell posted a solution for multiple subdomains in the following thread:

            https://forums.modx.com/thread/?thread=73312#dis-post-410056
              Frogabog- MODX Websites in Portland Oregon
              "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
              Having server issues? These guys have MODX Hosting perfected - SkyToaster