Revert "Use str_replace to make URL relative"

This reverts commit 196fdd726daa0375ba4b9a6ffb33f77f92a8e109.
Check if JURI::root returns empty value