Creating a custom 404 page following this. Set a page heading.
Get the 404 page heading.
Get the home page page heading…
Joomla Beta 3 from here :
Tested with a clean install…
Labels |
Added:
?
|
What is missing from those instructions is setting a hidden menu item for that article. Otherwise it will use the default itemid and therefore display any modules or menu params (such as the page heading) of the default menu item
I tried with hidden menus, but I get the same result.
Maybe I am doing something wrong, but do not see what.
I noticed something.
If I access any URL following this format:
I get the page_heading
from the HOME page instead of the actual URL.
As in this case, $this
returns all data from the HOME page.
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getActive();
$heading = $active->params->get('page_heading');
Yes that is correct because the URL doesnt have an Itemid
An Itemid ties the link to a menu item and if it doesnt have one then it uses the default
Use Joomla\CMS\Router\Route::_()
to get the correct URL. Though I wouldn't recommend following that guide. Such custom error page sends the wrong header (302 instead of 404). You should look for a plugin instead.
Yes that is correct because the URL doesnt have an Itemid
An Itemid ties the link to a menu item and if it doesnt have one then it uses the default
I am not sure I understand, as in my cases, all articles have an entry in menus.
Anyway, it can be very dangerous with negative SEO attacks.
Because of the two previous points, by default, all websites under Joomla are vulnerable to duplicate content attacks…
I just need to copy/paste the raw url here and there, and slowly but surely, I will see the target decline in SERP…
To protect websites I am working on, I wrote some code to generate canonical tag from raw urls, but I am not sure to consider all combinations, as articles and categories are accessible from these URLs:
so a single article/category is accessible from
Therefore, I wonder if I should forbid direct access from raw URLs.
Title |
|
Unfortunately the above tutorial is highly misleading. As others have said, this returns the wrong response code AND you need to have a menu item for your error article AND wrap your URL with a JRoute::_(). This isn't a bug in Joomla.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2021-03-18 05:37:17 |
Closed_By | ⇒ | HLeithner |