Create an external URL menu item and attempt to view it (I get 404s instead of being redirected to the URL configured).
Log into Joomla as Joomla Administrator (on /administrator URL).
In the Menus menu go to > 'All menu items'
On the Menus screen select 'New +'
Type/fill in 'Menu Title', 'Alias', choose a 'Menu *' from ' - Select Menu -' drop-down (I chose 'joomla' as the alias).
On Menu Item Type * (click ☰ Select)
Select 'System Links' from options list
In the Menu Item Type dialog select System Links and 'External URL An external or internal URL.'
On the 'Menus: New Item' screen type/fill in the 'Link' (I chose http://www.joomla.org-- any working URL is good for testing).
Hit 'Save' button at top.
In your browser go to url: <yoursite.ftw>/joomla (or alias you chose step 4)
I am getting a 404 on all 3 sites I have on Joomla 3.7.3
Browser navigates to External URL set in the menu.
404 on Joomla Instance
Joomla 3.7.3 on PHP 5.5 on LNMP stack-- SEF is turned on.
Was working in past 3.5.x? Possibly due to router/JRoute updates?
I tried some older patches I found on the web for mod_menu helper to no avail so far:
https://developer.joomla.org/joomlacode-archive/issue-26880.html
Thanks Franz.
I wonder if the 3.7.3 vs 3.7.4 makes a difference? All 3 of my Joomla instances are doing this.
I checked to see if https vs http made a difference and it didn't. I've got a pretty crappy work around going in my templates 404 error.php file to keep my site working til I figure out why the 404s:
//check missed External URLs
$qUrl = ltrim(rtrim(strtolower($_SERVER['REQUEST_URI']), '/'), '/');
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$conditions = array(
$db->quoteName('alias') . " = " . $db->quote($qUrl),
$db->quoteName('type') . ' = ' . $db->quote('url'),
$db->quoteName('published') . ' = 1' );
$query
->select(array('alias', 'link'))
->from($db->quoteName('#__menu'))
->where($conditions);
$db->setQuery($query);
$results = $db->loadAssoc();
/*
echo('');
*/
if( $results != null ) {
if( array_key_exists( 'link', $results ) )
{
$allDone = JFactory::getApplication();
$allDone->redirect( $results['link'] );
exit();
}
}
FWIW all three sites use different default templates. A few are GavickPro products.
Same Result using fresh installed 3.7.2. Have you tried using Protostar?
@franz-wohlkoenig Did you do step 10 or clicked the link on the frontend?
Whats the benefit of typing url instead using Menu?
Status | New | ⇒ | Discussion |
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-07-07 07:32:14 |
Closed_By | ⇒ | infograf768 |
Ahhh, sorry for the delay this is in a hidden menu so a clicking on a link is not an option here...
I see it works if the menu is is being output to html but not when in a hidden menu; sorry for missing this important detail. Dropping the alias isn't an option as I want to use the alias to get to the external URL (that I am putting into the menu item).
What's the correct way to do this in Joomla? Effectively a hidden menu item takes you off your Joomla site? Is there a way without using the Redirects section?
@reboot-sequence thanks for reporting Issue – can't confirm.
Set an external Link on http://www.joomla.org works as expected.
System information
3.7.4-dev (latest nightly build)
Multilanguage Site
macOS Sierra, 10.12.5
Firefox 54 (64-bit)
MAMP 4.1.1