0
votes

I would like to remove the article ID from Joomla SEF URLs. For that I found a mod which works only if the SEF URLs containing at least one character other that numbers. But I need numbers only SEF URLs for my articles.

For example: http://something.com/category/1234567890 But if I do this joomla returns 404 article not found error If I put any other char in like this http://something.com/category/1234567890-1 than it works.

How can I make it work with numbers only?

Oh and the mod which I tried is simply changing the 0 to 1 in the com_article/router.php in this code $advanced = $params->get('sef_advanced_link', 0);

1
That's a very strange url, how are you creating it? Is the number a string or is it the key for the article? I think it's probably looking in the database for an article or more likely maybe a category with that key but just a guess.Elin
I get that number from an automatically created excel sheet from a printig house and those articles are connected to printed materials and QR codes, but sadly I was left out from the process and now I have to deal with this. Nobody asked me if it's possible or not.Laci K
So what I mean is ... are you using the number in the alias field for the content item? Because that is what controls the url. It's very bizarre to have category like that. Are you getting that from something you typed or is Joomla generating it.Elin
The category name is just an example the real name of the category would translate to "wallets" in English, and the numbers I use as the aliasLaci K
Okay so you would have a menu link to wallets? I had not trouble at all using an alias with all numbers. No you don't need to turn on the "advanced" setting if you make the menu link.Elin

1 Answers

0
votes

Go to file components\com_content\router.php

and comment the folowing code :

    /*if (strpos($segments[0], ':') === false)
        {
            $vars['view'] = 'article';
            $vars['id'] = (int) $segments[0];

            return $vars;
        }*/

Hope that work for you