1

This is something that I noticed on one of my websites:

If I add certain digits after the home page URL, it does not give me a 404, as is expected. It displays the home page, with the browser page title taken from one of the other menu items. Here are some examples:

http://www.example.com/36-this-menu-item-does-not-exist In the above URL, if you change the 36 to a 32 or 37 it does the same http://www.example.com/12-this-shows-a-404-error

Has anyone seen anything like this?

I am wondering if it has to do with SEF Urls or perhaps something else.

I checked my .htaccess to make sure there are no redirects with these numbers in the URL.

Any tips will be appreciated.

2 Answers 2

1

It's just the way the router works. The number is the ID of the article. Joomla needs to know how to convert the URL to a page, and so one way is to look what number is in the URL and see if that matches an article.

Everything beyond the number is for SEO / human readable links, but Joomla doesn't need to know that, so it can be anything.

Your 404 pages presumably do not have articles with a matching ID.

If you want to see how this works, it is under components/com_content/router.php. It's quite well commented as to the process, the bit which seems to apply in this case being as follows:

/*
         * If there is only one segment, then it points to either an article or a category.
         * We test it first to see if it is a category.  If the id and alias match a category,
         * then we assume it is a category.  If they don't we assume it is an article
         */
1
  • Richard B thanks for pointing this out. This is exactly what is happening. Only when the number does not match an article or category ID does it route to a 404 page. Am a little surprised this is how it is designed and that it does not cause trouble with SEO and indexing. What is strange is that it always displays the home page (not the article it has the ID of) but with the browser title from the article.
    – PaxAnura
    Commented Apr 27, 2016 at 7:22
0

Yes, I have seen this happening before and it was caused by the Blank Component.

So, I guess you are likely using this component for having a modules only home page.

Unfortunately there was no fix for this, the last time I checked and I quickly revert back to the core way - by having for example a featured articles home page, with no article items at all, or a single article page loading modules.

2
  • Thanks for this info FFrewin. It is correct that I have a modules-only home page. I am not using the Blank Component, however. This only happens with certain non-existent URLs, Some show the home page and others give me a 404 error. I guess the best solution would be to go the core way (have a single article home page loading modules).
    – PaxAnura
    Commented Apr 26, 2016 at 8:40
  • @PaxAnura, if you are not using the blank component, then my answer is not for your case. You can either have featured articles or a single article page for home-page. So, something else is happening with your site.
    – FFrewin
    Commented Apr 26, 2016 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.