We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20080
    • 17 Posts
    I currenlty have modx installed in a subdirectory with a sub-domain pointing to that directory.

    http://www.mysite.com points to root/main
    http://sub.mysite.com points to root/modx

    I plan on changing it so my regular domain points to the modx subdirectory. My host provides a sub-domain pointing manager.

    http://www.mysite.com points to root/modx

    In modx all my links and templates use relative links (base/siteurl). Before I attempt to change this, is there anything I need to edit in Modx?

    It would seem too simple to just change it from the sub-domain pointing manager and have everything work as usual. I’m not using friendly urls, yet.

    I read the Wiki about developing locally and then porting it over, but I’m not sure if that applies to this situation.
      www.DMSalesSolutions.com New Site using Modx (still learning though)
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Just check your .htaccess file to make sure it’s using the correct RewriteBase, then in the Configuration, in the Interface and Features tab as well as the File Manager tab make sure the path is set correctly to the full file path for your installation.
        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
        • 20080
        • 17 Posts
        Looks simple enough, but I’m scared.

        curenlty have a ht.access file in the modx root.


        This is my root: /serverstuff/blah/blah/myaccount/

        File manager says: /serverstuff/blah/blah/myaccount/modx2/

        Interface & Features says: /serverstuff/blah/blah/myaccount/modx2/assets/ (same thing except adds assets dir)

        According to the Wiki,http://wiki.modxcms.com/index.php/Friendly_URLs_Guide, if I installed it into a folder, I should add do the following:

        4.If you use pre 0.9.5 MODx add the following setting to the .htaccess file:
        1.RewriteBase / if MODx is installed to the site root
        2.RewriteBase /folder if MODx is installed in to a subfolder called "folder"
        5.If you have installed MODx in to a subfolder you may also need to do the following change:
        1.change RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] into RewriteRule ^(.*)$ /folder/index.php?q=$1 [L,QSA]

        But if I can point www.mysite.com directly to the /modx sub-directory (from the hosts "domain pointing manager thing", I should leave out the folder name right? huh

        I’m not too familiar with "waht happens" and how the .htaccess file impacts your site when you click on "use firendly URL’s." I have used Drupal and Joomla in the past. Drupal works perfectly fine with friendly’s, but I got some errors with Joomla. In drupal I just clicked on the button durring the install/configuration and it worked. With Joomla, I created pages and content then decided to change to friendly urls.

        That’s kind of why I’m scared of chaning to friendly URLs now that I have content in modx. If I have links using [~id~] will I need to change those to the alias? or will it automatically find the appropriate alias?


        Below are the contents of my file.

        # For full documentation and other suggested options, please see
        # http://svn.modxcms.com/docs/display/MODx096/Friendly+URL+Solutions
        # including for unexpected logouts in multi-server/cloud environments
        # and especially for the first three commented out rules
        
        #php_flag register_globals Off
        #AddDefaultCharset utf-8
        #php_value date.timezone Europe/Moscow
        
        Options +FollowSymlinks
        RewriteEngine On
        RewriteBase /
        
        # Fix Apache internal dummy connections from breaking [(site_url)] cache
        RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
        RewriteRule .* - [F,L]
        
        # Rewrite domain.com -> www.domain.com -- used with SEO Strict URLs plugin
        #RewriteCond %{HTTP_HOST} .
        #RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
        #RewriteRule (.*) http://www.example.com/$1 [R=301,L]
        
        # Exclude /assets and /manager directories and images from rewrite rules
        RewriteRule ^(manager|assets)/*$ - [L]
        RewriteRule \.(jpg|jpeg|png|gif|ico)$ - [L]
        
        # For Friendly URLs
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
        
        # Reduce server overhead by enabling output compression if supported.
        #php_flag zlib.output_compression On
        #php_value zlib.output_compression_level 5
          www.DMSalesSolutions.com New Site using Modx (still learning though)