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 '14 at 14:08
  • Another way to solve this is to add RewriteBase /~sitethingy to the .htaccess file although maybe not a long term solution. – Neil Robertson Dec 11 '14 at 10:38

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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