I'm developing a component in Joomla! 3.9.13 with SEF urls turned ON and I use this line of code
JRoute::link( 'site', 'index.php?option=com_mycomponent&task=profile.edit', false, JRoute::TLS_IGNORE, true )
and - depending on the application context - it generates two different urls. When called from within the 'administrator' context I get
When using it in the 'site' app, I get
I've read that the first parameter 'site' would force Joomla! to use the site context but obviously it doesn't work. I couldn't find a clear answer to this, especially not for the current Joomla! version 3.9.x so I'd be grateful if anybody could shed some light on this.