We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9496
    • 113 Posts
    So I have a site that I will be hosting which is currently be hosted at another IP. I havent switched over the DNS yet, so my only way to access the site is via the plesk site preview. I can preview the page and the url is formatted as such:

    https://XX.XX.XXX.XX:XXXX/sitepreview/http/my-site.com/index.html


    I can get the install working but all of the links that are generated resolve to:

    http://my-site.com/xxxx


    Which basically means that modX is rewriting the links (as obviously it should) but for my purposes nothing works because of the relative root path reversion. I think I need to add the https://XX.XX.XXX.XX:XXXX/sitepreview/http/ prefix to the site_url (at least temporarily until I switch the DNS over) but I’m not sure how to accomplish this. I would think either through the config file or via htaccess. Ideally it woul be global so that modx temporarily resolves / to https://XX.XX.XXX.XX:XXXX/sitepreview/http/.

    Any help would be appreciated-
    thanks-
    P
      • 4310
      • 2,310 Posts
      Untested but you could try in your htaccess file :
      RewriteBase https://XX.XX.XXX.XX:XXXX/sitepreview/

      See what happens wink
        • 9496
        • 113 Posts
        unfortunately that didnt work. I think If I can set the base_url or site_url to that value that may work. I suppose Id need to set the base_path as well. It looks like the rewrite works fine, but when its building the relative link it only uses my-site.com/.
        So Im not too sure if that can be accomplished via htaccess (I dont see why not though..)
        P
          • 22303 MODX Staff
          • 10,725 Posts
          Just hardcode the temporary URL in your template( s’ ) base tag, i.e.
          <base href="https://XX.XX.XXX.XX:XXXX/sitepreview/http/my-site.com/"></base>
            • 9496
            • 113 Posts
            That would be a good idea but I cant get into the manager. Im figuring from what Ive read around its kind of a jacked up plesk thing. I cant seem to get the site_url, base_url in the config file to work either. No worries though, I have it on a subdomain of my current server, and when the client approves it Ill pop everything over. Dont want to go too far down the DNS hole if ya catch my drift.

            Thanks for the input though.
            P
              • 19909
              • 49 Posts
              Easy answer... if you are still interested

              From Settings, goto IP Addresses

              Click on the IP that you have assigned for the new site

              Change Default domain to that of the Site you are preparing.

              Then in your browser just use your IP Address to view the site - no DNS changes necessary anywhere !
                • 30731
                • 4 Posts
                huh

                You recommend I go to settings... these are the settings in Plesk or in Modx Manager?

                Thanks.
                  • 19909
                  • 49 Posts
                  This is in Plesk, there is a section called IP addresses - from here you can set a domain to be the default served by any of your IP addresses. Then just point your browser at the IP address to view your site.