Advertisement

SEF URLs working except for article links

Discuss Search Engine Optimization in relation to Joomla! 5.x. This forum will also have discussions on SEF/SEO Joomla! 5.x extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
Mykoss
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Jun 06, 2024 2:49 am

SEF URLs working except for article links

Post by Mykoss » Thu Jun 06, 2024 4:53 am

Hi,

I am getting nice URLS that look like this:
example.com/menucategory/menuitem

however any article links look like this:
example.com/menucategory/menuitem?view=article&id=378:name-of-article&catid=42

- Joomla 5.1.1
- Global Configuration / Site / SEF URLs = enabled and URL rewriting = enabled
- Global Configuration / Articles / Integration / Routing : Remove IDs from URLs = enabled

This site was upgraded from 3.10 where the links used to look like:

example.com/26-announcements/107-name-of-article

which is cleaner than what I'm getting now.
I have another site that is a fresh install of J5.1.1 and I'm getting the same thing, so it's not due to the migration from 3 to 4 to 5.

ideally I want no id's in there like this:
example.com/announcements/name-of-article

Am I missing something? I can't work out how to achieve this.
Any help would be much appreciated!!

Thanks

PS. I'm aware that if I create a menu item linked to each article then it will use the menu alias for it, but I'm looking for a solution for article links specifically.

Advertisement
User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44251
Joined: Sat Apr 05, 2008 9:58 pm

Re: SEF URLs working except for article links

Post by Webdongle » Thu Jun 06, 2024 9:12 am

Create a menu item for those Articles or for the categories.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Mykoss
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Jun 06, 2024 2:49 am

Re: SEF URLs working except for article links

Post by Mykoss » Thu Jun 06, 2024 10:07 am

Thanks but I did specify that I need a solution that doesn't require creation of menu items for each article

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44251
Joined: Sat Apr 05, 2008 9:58 pm

Re: SEF URLs working except for article links

Post by Webdongle » Thu Jun 06, 2024 2:32 pm

afaik that is the only way to do it unless there is a 3rd party extension or you write some sort of script.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Mykoss
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Jun 06, 2024 2:49 am

Re: SEF URLs working except for article links

Post by Mykoss » Fri Jun 07, 2024 12:19 am

From the Joomla Documentation:
Without SEF URLs turned on, the URL is example.com/index.php?option=com_content&view=article&id=1:welcome-to-joomla&catid=1:latest-news&Itemid=50
With SEF URLs on and mod_rewrite off, it's example.com/index.php/the-­news/1-­latest­-news/1­-welcome­-to­-joomla
With both SEF URLs and mod_rewrite on, it's example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla

I just want to achieve this and have my hundreds of links from J3 still work that look like this:
example.com/26-announcements/107-name-of-article

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44251
Joined: Sat Apr 05, 2008 9:58 pm

Re: SEF URLs working except for article links

Post by Webdongle » Fri Jun 07, 2024 3:24 am

That is different to what you posted in your first post.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Mykoss
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Jun 06, 2024 2:49 am

Re: SEF URLs working except for article links

Post by Mykoss » Fri Jun 07, 2024 5:54 am

OK, I guess I wasn't clear enough in my initial post.
I hope my last post cleared that up.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44251
Joined: Sat Apr 05, 2008 9:58 pm

Re: SEF URLs working except for article links

Post by Webdongle » Fri Jun 07, 2024 9:22 am

Ok

Your first post suggested that you can remove the index.php but get category and article id's for articles that have no menu item.

Your last post says you can't remove the index.php and are not concerned about category and article id's showing.

To solve the former create menu items.

For the latter see https://docs.joomla.org/Enabling_Search ... EF%29_URLs
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

Mr. Wimpy
Joomla! Guru
Joomla! Guru
Posts: 504
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: SEF URLs working except for article links

Post by Mr. Wimpy » Fri Jun 07, 2024 10:44 am

You said that you updated from J3.

Do you use the latest htaccess that comes with J5?
Or are you still using the J3 htaccess?

If you are, replace the J3 htaccess with the J5 htaccess.
Rename the old .htaccess to something like htaccess-old.txt just in case

Mykoss
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Jun 06, 2024 2:49 am

Re: SEF URLs working except for article links

Post by Mykoss » Mon Jun 10, 2024 1:16 am

Yes I've replaced the J3 htaccess with the J5 htaccess.
Mr. Wimpy wrote: Fri Jun 07, 2024 10:44 am You said that you updated from J3.

Do you use the latest htaccess that comes with J5?
Or are you still using the J3 htaccess?

If you are, replace the J3 htaccess with the J5 htaccess.
Rename the old .htaccess to something like htaccess-old.txt just in case

Mykoss
Joomla! Apprentice
Joomla! Apprentice
Posts: 6
Joined: Thu Jun 06, 2024 2:49 am

Re: SEF URLs working except for article links

Post by Mykoss » Mon Jun 10, 2024 1:47 am

I'm not sure where you think I indicated not being able to remove the index.php.
Please allow me to attempt to clarify:

Let me start by stating that I am specifically looking for a solution that does not require creating menu items.

**The 1st and main part of my question is this:

I am getting nice URLS that look like this:
example.com/menucategory/menuitem

however any article links look like this:
example.com/menucategory/menuitem?view=article&id=378:name-of-article&catid=42

From the 3 examples given from the Joomla Documentation, it looks like SEF rewriting is not working as intended.

From the Joomla Documentation:
Without SEF URLs turned on, the URL is example.com/index.php?option=com_content&view=article&id=1:welcome-to-joomla&catid=1:latest-news&Itemid=50
With SEF URLs on and mod_rewrite off, it's example.com/index.php/the-­news/1-­latest­-news/1­-welcome­-to­-joomla
With both SEF URLs and mod_rewrite on, it's example.com/the-­news/1­-latest-­news/1-­welcome-­to­-joomla

Since my URL looks like:
example.com/menucategory/menuitem?view=article&id=378:name-of-article&catid=42

example.com/menucategory/menuitem
This first part of the URL is correct. We can see that the index.php is being removed, which indicates the mod_rewrite is working

?view=article&id=378:name-of-article&catid=42
however the SEF URL component does not appear to be working for the rest of the URL.
Is there something I need to do to get this working as intended? It was working in J3.


** The second part of my question is this:

In Articles / Options / Integration there is a switch called "Remove IDs from URLs".
It looks like this will go one step further and remove the id's from the URL. Great!
I have this enabled but it doesn't seem to do anything.
Is there something I need to do to get this working as intended?
Is the fact that the SEF URLs part isn't working, stopping this from working maybe?

Thanks.


Webdongle wrote: Fri Jun 07, 2024 9:22 am Ok

Your first post suggested that you can remove the index.php but get category and article id's for articles that have no menu item.

Your last post says you can't remove the index.php and are not concerned about category and article id's showing.

To solve the former create menu items.

For the latter see https://docs.joomla.org/Enabling_Search ... EF%29_URLs

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44251
Joined: Sat Apr 05, 2008 9:58 pm

Re: SEF URLs working except for article links

Post by Webdongle » Mon Jun 10, 2024 3:23 am

Then the solutions to your problem are
Create menu items for your articles
Or
Use a 3rd party extension
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 31159
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: SEF URLs working except for article links

Post by Per Yngve Berg » Mon Jun 10, 2024 5:31 am

There is a routing.php in com_content. It looks like this file is still in the J3 version.

shumisha
Joomla! Guru
Joomla! Guru
Posts: 527
Joined: Sat Aug 20, 2005 3:15 pm
Contact:

Re: SEF URLs working except for article links

Post by shumisha » Mon Jun 24, 2024 7:56 am

Hi

Joomla leaves the query string you are seeing (the part after the ?: ?view=article&id=378:name-of-article&catid=42) when it does not find a proper menu item for that URL.

Having fully SEF URLs does not require that you create a menu item for each article. But if that's not the case, it does require that there's a suitable menu item for the category of a given article.

In your case, it must be able to find a menu item for category 42.

One thing seems odd in your description. Your URLs start with:

/menucategory/menuitem

What are these menu items?

- is /menucategory a blog/list view of category 42?
- if so, what is /menuitem? what type of menu, leading to what item?
4SEO, 4AI, 4Command, 4Podcast, 4Video, SEO and content extensions for Joomla 3, 4 & 5 - https://weeblr.com
I don't reply to PM anymore. Thanks for using our extensions.

roberb7
Joomla! Apprentice
Joomla! Apprentice
Posts: 14
Joined: Wed Jun 25, 2008 5:34 am

Re: SEF URLs working except for article links

Post by roberb7 » Thu Jul 18, 2024 11:14 pm

Mykoss wrote: Thu Jun 06, 2024 10:07 am Thanks but I did specify that I need a solution that doesn't require creation of menu items for each article
I had this problem, and was tearing my hair out trying to fix it. I finally managed to solve it.
First, you don't have to create a menu item for each article. Creating a menu item for each article category is sufficient.
Second, it doesn't have to be a visible menu item. Just create a fake menu, then add all of your article categories to it. Problem solved.

Advertisement

Post Reply

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 5.x”