We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4095
    • 372 Posts
    I have a link that currently points to http://domain.isp/~mysite/assets/files/documnet.pdf and soon I’ll change my current domain name to point to this site. So the URL will become http://mysite.com/assets/files/documnet.pdf and I’m thinking that the links wont work.

    I’m using SEF URLs and Rewrite image paths, but I don’t see how that will help documents as it doesn’t use "SRC".

    Is there anyway to set a varable for base URL or will MODx work it out itself?

    Fo allthe links I am using [~document id~] not the URL so the internal links will work if they are changed later.

    Cheers.
      [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
      Admin Sandbox Login: sandbox Password: castle
      • 6726
      • 7,075 Posts
      Hmmm, not sure there but it would seem manager/includes/config.inc.php "automatically assign base_path and base_url", the path is not hardcoded, I guess you don’t need to do anything...
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
      • Might want to check the System configuration for the paths for the RTE and the file manager, though.
          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
          • 4095
          • 372 Posts
          Thanks guys..... one less thing to stress about as our go live dealine looms up fast. Go MODx smiley
            [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
            Admin Sandbox Login: sandbox Password: castle
          • I’m not so certain that the image path rewriting is not in fact hard coded to the place when you hit the save button. Not certain, but I’ve never used it for that exact reason. Guess we’ll have a pretty good test case of that soon! wink
              Ryan Thrash, MODX Co-Founder
              Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • Also guys, all the following are available for use anywhere on a page -->

              [(base_path)] --> the base filesystem path to the installation

              [(base_url)] --> the absolute URL to the root of the MODx installation relative to the web root

              [(site_url)] --> the full URL to the site root including the protocol (http:// or https://) and hostname
                • 4095
                • 372 Posts
                Quote from: rthrash at Nov 30, 2005, 02:15 PM

                I’m not so certain that the image path rewriting is not in fact hard coded to the place when you hit the save button. Not certain, but I’ve never used it for that exact reason. Guess we’ll have a pretty good test case of that soon! wink

                Ok heres the update to what happened. I’ll use image.gif as an example

                Using base_url or site_url worked fine from the front end.

                base_url added
                ../../../../../
                before the /assests/images/image.gif. After I added <base href="[(site_url)]" /> in template, it showed /assests/images/image.gif

                site_url looked like http://domain.com/assests/images/image.gif

                What I did discover is that the image was not visible from the backend (or quickedit) when edit the page with a WYSIWYG editor as it wasn’t able to evaluate the variables.

                I would like to suggest that this is improved, although it didn’t affect the web users, I still had to update every image on the site so the editors could see the image when using a WYSIWYG editor, defeating the advantage of using the variable in the first place.

                When images were added using thew WSIWYG editor and not using variables they were given the old URL of the development site and therefore didn’t work when moved to the new site.

                FYI image links without http:// also aren’t shown in the WYSIWYG editor
                  [img]http://www.emanz.ac.nz/assets/images/logo/emanz-icon_16x16.gif[/img] Emergency Management Academy of New Zealand [br] http://www.emanz.ac.nz[br][br]MODx Sandbox Login: sandbox Password: castle [br]
                  Admin Sandbox Login: sandbox Password: castle