We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37550 ☆ A M B ☆
    • 711 Posts
    Hi all.

    I’m working on a worldpay callback page and have hit a problem, currently all my chunks refer to [[base_url]]assets/images/bla.jpg this is for images and css now when i am sent back from worldpay it calls the site back using https:// however the base_url is blank which results in the page displaying with missing css and images.

    Is it possible somehow to set the [[base_url]] for a specific page as currently all my templates refer to this variable and it would be a nightmare to have to copy all the chunks just for one worldpay call back page.

    Any thoughs would be much appreciated.

    Thanks
      http://www.onesmarthost.co.uk
      UK MODX Hosting with love.
      • 4041
      • 788 Posts
      i dont know for sure if this will work, but it may be a start point for you...

      make a snippet named whatever you want, for this example it will be called
      [!WorldPay_redirect!]
      then call it in the top of your templates

      <?php
      if($_SERVER['HTTP_REFERER'] =="https://worldpay.com/page you came from"){
        header("Location: index.php?id=xx");
      }
      ?>
        xforum
        http://frsbuilders.net (under construction) forum for evolution
        • 22303 MODX Staff
        • 10,725 Posts
        You should probably just rewrite any requests to https pages using mod_rewrite...
        RewriteCond %{SERVER_PORT} ^443
        RewriteRule (.*) http://yourdomain.com/$1 [R=301,L]


        FYI, base_url (and site_url) are set on each request, based on how the request was formed.
          • 37550 ☆ A M B ☆
          • 711 Posts
          I will those a go and see what happens.

          Thanks Aaron smiley
            http://www.onesmarthost.co.uk
            UK MODX Hosting with love.