We're running our sites on a VPS - When we're running our sites with a domain name, all images are detected just fine, but when we're running it from our pre-production thing on the VPS, the URL generated into the CSS should be: vps.com/~sitethingy/images/etc but it is generated as vps.com/images/etc instead.

We're using the JURI::root function.

Any idea how to fix this so it'll work on our pre-production sites as well?

  • What happens if you use JUri::base() ?
    – Lodder
    Dec 10, 2014 at 14:08
  • Another way to solve this is to add RewriteBase /~sitethingy to the .htaccess file although maybe not a long term solution. Dec 11, 2014 at 10:38

1 Answer 1


Will put this as a proper answer for a reference.

Rather than using JUri::root(), you need to use JUri::base().

The difference being (I think) is that root can be overridden, where as base can't be. Might be wrong, but hopefully someone can clarify this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.