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

    I am writing a site using the MODx CMS. I am using the friendly Urls, and so need to use .htaccess files.

    It all works fine.

    But.

    The site I am uploading into the CMS has links relative to somewhere else on the server.

    ie: img src="454.jpg" on a server http://web address 1.com

    script installed at /modx on server http://web address 2.com

    I am trying to link the images that SHOULD be found in the /modx directory, but NOT its subdirectories to web address1 (ie templates folder) (which is on the same server).


    I am also trying to get links that go to .htm pages http://webaddress2.com to be directed to http://webaddress2.com/modx, where they can be picked up by the .htaccess file in the /modx folder. Is this possible?

    Thank you
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You’ll need to use absolute paths for those images, unless you know of some way to add rewrite rules for .jpg or .png files.

      If your modx is in a subdirectory, see the comments in the .htaccess file for how to adjust it to deal with the second issue.
        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
        • 33372
        • 1,611 Posts
        I would think that you could rewrite the paths to your images with something like
        RewriteRule ^(.*)\.jpg$ http://webaddress1.com/$1.jpg [NC]
        although I’m not sure how badly that would mess up your inserting and previewing inside the RTE...
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Maybe setting the path in the Configuration in the tab for the RTE to the other domain’s image folders?
            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