I'm accessing the Joomla framework from some external code as in this answer. The website is at http://localhost/joomla/
and the external code is in http://localhost/joomla/external/index.php
I have JPATH_BASE
set properly to the Joomla root, and generate a URL like this:
JRoute::_('index.php?option=com_users&view=login')
But that comes back with the URL /joomla/external/index.php/login
instead of what it should be: /joomla/index.php/login
How to fix this?
Edit: to make clear, I'm looking for a general solution for any folder structure. The external folder could be in another location e.g. http://localhost/external/