Remove article id from url for joomla 3.0

Discuss Search Engine Optimization in relation to Joomla! 3.x. This forum will also have discussions on SEF/SEO Joomla! 3.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.
User avatar
rich1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 190
Joined: Sun Apr 05, 2009 2:17 am
Location: London SE
Contact:

Re: Remove article id from url for joomla 3.0

Postby rich1 » Mon Jun 15, 2015 9:12 am

@lorenz864
I looked at the hack from Kubik-Rubik and it does not include Step 2 from the post:
viewtopic.php?f=712&t=826165&p=3310936#p3285254
If no menu item points to an article and if the article uses only one word in the alias then there are issues you get a 404.
I have tested the aboenzli post in the link above in J3.4.1 and it works as described, no 404 with single word aliases.
If you have no 'Coeur de Lion' do not ask why you fail.

4commerce
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Fri Aug 22, 2014 9:34 pm

Re: Remove article id from url for joomla 3.0

Postby 4commerce » Wed Jul 01, 2015 10:14 pm

Josh Lewis wrote:Good news ladies and gentlemen:

Therefore 3.5 will be shipping with 2 main new features - the work done by Hannes Papenberg on the new Routing system and the code already merged by Nic Dionysopoulos to give email notifications on Joomla Updates.


- Source

According to the dev section, the new routing system will indeed be added to the next major release of Joomla. 8)


These are great news! But there is no word about when this update will be released...
Also I have other doubts from the SEO perspective, what will be happening with the pages that already have ranking on SERPs (with IDs), should we have to create 301 redirects for each page???
Or it will be another way to avoid losing traffic to our sites?
Regards!

User avatar
AndresNWD
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 176
Joined: Thu Sep 06, 2012 1:45 pm
Location: Granada-Spain
Contact:

Re: Remove article id from url for joomla 3.0

Postby AndresNWD » Thu Jul 09, 2015 1:13 pm

4commerce wrote:Also I have other doubts from the SEO perspective, what will be happening with the pages that already have ranking on SERPs (with IDs), should we have to create 301 redirects for each page???
Or it will be another way to avoid losing traffic to our sites?
Regards!


As long as I know, unless you make a 301 once you change an url name, that page is a completely different page for Google. Not sure if there're tools to handle this, like SEF404 or similar, any input on this?
I work at
http://www.component-creator.com - Easy Joomla MVC development
http://www.neno-translate.com - The complete translation solution for Joomla

brunog916
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Aug 29, 2012 9:12 am

Re: Remove article id from url for joomla 3.0

Postby brunog916 » Thu Jul 30, 2015 9:56 am

To fix index problem it is enough to create a couple of rules in htaccess related to the name of your categories:
RewriteCond %{REQUEST_URI} ^(.*)your-catecory-name/[0-9]{1,4}-(.*)
RewriteRule ^(.*)your-category-name/[0-9]{1,4}-(.*) /your-category-name/$2 [R=301,L]

This could be useful even with next joomla release not to loose ranking when article id will be removed from the core

User avatar
rich1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 190
Joined: Sun Apr 05, 2009 2:17 am
Location: London SE
Contact:

Re: Remove article id from url for joomla 3.0

Postby rich1 » Sat Aug 29, 2015 11:22 am

brunog916 is quite right!
I used the htaccess rule a while ago after implementing the fix:
viewtopic.php?f=712&t=826165&p=3310936#p3285254
on a site that had already had the old ID's in SERP.
It is a simple rule removing numeric characters and the dash.
If you have no 'Coeur de Lion' do not ask why you fail.

User avatar
Josh Lewis
Joomla! Guru
Joomla! Guru
Posts: 528
Joined: Wed Jun 11, 2008 11:12 pm
Location: Lynnwood,WA
Contact:

Re: Remove article id from url for joomla 3.0

Postby Josh Lewis » Sat Aug 29, 2015 7:18 pm

That .htaccess rule looks pretty sweet. :) I'm curious how one would go about that if your url structure is example.com/article-name

Would you simply remove the category name from the .htaccess mod? I'm not using any SEF extensions to pull this off, but rather a trick that involves loading content from a blank blog as the main menu item.

User avatar
rich1
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 190
Joined: Sun Apr 05, 2009 2:17 am
Location: London SE
Contact:

Re: Remove article id from url for joomla 3.0

Postby rich1 » Sat Aug 29, 2015 7:26 pm

@ Josh Lewis

Code: Select all

RewriteCond %{REQUEST_URI} ^(.*)/[0-9]{1,4}-(.*)
RewriteRule ^(.*)/[0-9]{1,4}-(.*) /$2 [R=301,L]

Basically I would be surprised if a single article name would have an ID as it would require a menu item with an alias, (assuming you are working with SEF enabled).
I don't use SEF extensions either.
I do have reDJ installed as a component for redirects instead of using the Joomla native Redirect.
Most of the work I do is with htaccess though.
However the above would take all ID's and dash from everything above root.
That is the rewrite I have been using for some time now.
Even with installations that have K2 as K2 already has a router to combat ID's.

However with some other components that still use ID's, (and need them), I create separate rewrite rules for those components.
The order you place these in htaccess is important too.
Also you may have to drop the [L], (last rule), if applicable, then place it on another rule.

So if you have a Menu Item to a Top Level Category Blog, the above is all you need to strip all ID's and dashes from SERP, with the router hack mentioned earlier.
301 tells Search Engines it is now permanent.
302 tells them it is temporary.
If you have no 'Coeur de Lion' do not ask why you fail.

microtribe
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Oct 05, 2007 6:33 pm
Location: Houston, TX
Contact:

Re: Remove article id from url for joomla 3.0

Postby microtribe » Wed Nov 04, 2015 12:54 am

@Josh regarding the work done by Hannes Papenberg on the new Routing system - will this effect the URL issue discussed in this post? I read about the work on the crowdfunding campaign, but didn't understand it: https://www.indiegogo.com/projects/adva ... r#/updates

Travelguy
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Tue Jun 02, 2009 9:42 pm

Re: Remove article id from url for joomla 3.0

Postby Travelguy » Thu Nov 26, 2015 8:05 pm

Hi @microtribe, I'm assuming that version 3.5 does address this issue, in fact I'm counting on it as I don't want yet another extension clogging things up or a hack that may not be needed come that release,
I assume it'll be released before the end of the year.

User avatar
Josh Lewis
Joomla! Guru
Joomla! Guru
Posts: 528
Joined: Wed Jun 11, 2008 11:12 pm
Location: Lynnwood,WA
Contact:

Re: Remove article id from url for joomla 3.0

Postby Josh Lewis » Thu Nov 26, 2015 11:31 pm

"The new routing system will not be merged into the 3.5 release. The routing will be postponed until 3.6 because the work is not complete and has not been tested thoroughly." - Joomla Beta 1 Article

FrancoisRJoom
Joomla! Apprentice
Joomla! Apprentice
Posts: 35
Joined: Wed Oct 21, 2015 12:54 pm

Re: Remove article id from url for joomla 3.0

Postby FrancoisRJoom » Thu Feb 18, 2016 1:50 am

hello everyone,

I modified the file component/com_content/router.php just as Aboenzli said in this topic before viewtopic.php?f=712&t=826165&start=60#p3285254
It seemed to work perfectly.
But I found a plugin doing just the same thing and nothing else. So I removed my change to the router.php file and used this plugin instead :

Direct Allias Pro : http://extensions.joomla.org/extension/direct-alias-pro

User avatar
Josh Lewis
Joomla! Guru
Joomla! Guru
Posts: 528
Joined: Wed Jun 11, 2008 11:12 pm
Location: Lynnwood,WA
Contact:

Re: Remove article id from url for joomla 3.0

Postby Josh Lewis » Tue Mar 01, 2016 4:05 pm

Another promising looking alternative to those interested: http://extensions.joomla.org/extensions ... for-joomla

Supposedly this extension works on all native components of Joomla which sounds really awesome. :-)

haralake
Joomla! Apprentice
Joomla! Apprentice
Posts: 25
Joined: Mon Jan 23, 2012 11:18 am

Re: Remove article id from url for joomla 3.0

Postby haralake » Tue Mar 22, 2016 1:50 pm

Hello,
I'm creating a new site and the id numbers on URLs really bothers me. I really don't want to hack the core, so i find a way to remove them creating hidden menu items for every article i have in my blog (currently a few articles..).

If in future joomla releases this router (problem) fixed, i will remove all those hidden menu items for my articles. Is this ok? Or this will cause problem with my URL structure? If i remove my hidden menu items (with updated joomla new router) i guess that the URLs will be exactly the same as they are with menu items enabled. Is this correct?

Thank you

User avatar
Josh Lewis
Joomla! Guru
Joomla! Guru
Posts: 528
Joined: Wed Jun 11, 2008 11:12 pm
Location: Lynnwood,WA
Contact:

Re: Remove article id from url for joomla 3.0

Postby Josh Lewis » Tue Mar 22, 2016 3:55 pm

haralake wrote:If in future joomla releases this router (problem) fixed, i will remove all those hidden menu items for my articles. Is this ok? Or this will cause problem with my URL structure? If i remove my hidden menu items (with updated joomla new router) i guess that the URLs will be exactly the same as they are with menu items enabled. Is this correct?


Having and removing the hidden menu items should be just fine assuming you don't require special parameters per article (as in unique options from one article to another). Personally I am still a big fan of the hack method, components/com_content/router.php is not updated very often. I keep a copy of it so that I don't have to rewrite the code when it does change on the very rare occasions. Upgrading to Joomla 3.4 to 3.5 was one of the rare occasions. However no modification to the file was needed, I simply replaced my modded router.php into components/com_content/. Attached to this post is a working copy of router.php that removes article id's and is compatible with Joomla 3.5.

I used to create menu items per article, but eventually I realized that this is a pain and is not needed. I have written a lot of articles. If I did not have the mod method, I would use a plugin for this.
You do not have the required permissions to view the files attached to this post.

tehribo
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Sun Jan 02, 2011 3:42 pm

Re: Remove article id from url for joomla 3.0

Postby tehribo » Wed Mar 30, 2016 11:54 am

Josh Lewis, I made the "hack" but the article ID is still there.

Joomla seems to be dying :(

User avatar
Josh Lewis
Joomla! Guru
Joomla! Guru
Posts: 528
Joined: Wed Jun 11, 2008 11:12 pm
Location: Lynnwood,WA
Contact:

Re: Remove article id from url for joomla 3.0

Postby Josh Lewis » Wed Mar 30, 2016 9:37 pm

tehribo wrote:Josh Lewis, I made the "hack" but the article ID is still there.


Did you replace the attached (previous post) router.php file into components/com_content/router.php? Do you have "Use URL Rewriting" enabled so that .htaccess is being used? I just re-tested this on Joomla 3.5 on a fresh site which it worked. Also if you have a caching mechanism running you may need to clear it (especially if it's on the web host's end).

tehribo wrote:Joomla seems to be dying :(


Things are slowing down, but I wouldn't say dying. Corrections to the CMS are still being made. In terms of new features it's best to invest in extensions and their developers. In my case the guys at Stackideas put in new features to Joomla community software frequently. :)

draculinos
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 116
Joined: Fri Jul 21, 2006 12:22 pm
Contact:

Re: Remove article id from url for joomla 3.0

Postby draculinos » Sat Apr 02, 2016 9:08 pm

Hello
Your files has an old router.php .
The file has change a lot in new 3.5 Joomla.

Thanks

User avatar
Josh Lewis
Joomla! Guru
Joomla! Guru
Posts: 528
Joined: Wed Jun 11, 2008 11:12 pm
Location: Lynnwood,WA
Contact:

Re: Remove article id from url for joomla 3.0

Postby Josh Lewis » Sat Apr 02, 2016 9:28 pm

draculinos wrote:Hello
Your files has an old router.php .
The file has change a lot in new 3.5 Joomla.


That may be so, however my old router.php does the trick just fine with Joomla 3.5. :)

emeyer
Joomla! Explorer
Joomla! Explorer
Posts: 352
Joined: Thu Sep 29, 2005 2:37 am

Re: Remove article id from url for joomla 3.0

Postby emeyer » Thu Apr 07, 2016 7:07 am

I spent several months working on a plugin to solve this problem. I would like to share it and get some feedback, but I had a complaint from system administrator saying I am not allowed to share it publicly as it is considered self promotion. So if you want to try it you will have to send me a private message, and frankly, I will not be so friendly again in this community. I have not heard a single kind word from a single member of the Joomla developer or support team since 2006, despite several offers to volunteer.

webdesco
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Wed Oct 07, 2009 12:21 pm

Re: Remove article id from url for joomla 3.0

Postby webdesco » Sun Apr 10, 2016 1:43 pm

FYI,
the two line edit of router.php on Joomla 3.5.1 does not remove the ID from tag urls
eg: use the joomla Tags Popular Module give a url in the form of /tags/4-technology.html
where 4 is the article id.
I've found a post with a .htaccess method of removal but none that work with the current router.php

User avatar
ChasL
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Apr 30, 2013 5:40 am
Location: Thame UK
Contact:

Re: Remove article id from url for joomla 3.0

Postby ChasL » Mon Apr 25, 2016 9:13 am

Josh Lewis wrote:Another promising looking alternative to those interested: http://extensions.joomla.org/extensions ... for-joomla

Supposedly this extension works on all native components of Joomla which sounds really awesome. :-)


This extension (Plugin) works really well in Joomla 3.5.1.

Upload, search plugins for SEF tick to activate and you're done. ID's just vanish from the URLS. Perfect. Thanks for the recommendation.

PS, click the Plugin for extra options.

lpgratton
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 15, 2010 11:00 am

Re: Remove article id from url for joomla 3.0

Postby lpgratton » Thu Apr 28, 2016 3:36 am

The two step hack mentioned above works well, but a php notice is served on single word alias articles:

“Notice: Undefined offset: 1 in /xxx/xxx/xxx/components/com_content/router.php on line 348”

If one makes a mistake in the primary category while typing the url, the notice reads as follow:

“Notice: Undefined index: id in /xxx/xxx/xxx/components/com_content/router.php on line 410

Warning: Cannot modify header information - headers already sent by (output started at /xxx/xxx/xxx/components/com_content/router.php:410) in /xxx/xxx/xxx/templates/xxx/error.php on line 12”

Is there something that can be done about it?

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

Re: Remove article id from url for joomla 3.0

Postby Webdongle » Thu Apr 28, 2016 7:43 am

Change the error reporting in Global config ?

lpgratton
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 15, 2010 11:00 am

Re: Remove article id from url for joomla 3.0

Postby lpgratton » Thu Apr 28, 2016 1:24 pm

I mean not something to be done about hiding the error messages, but something to solve the problems related to the errors.

rgblogs
Joomla! Apprentice
Joomla! Apprentice
Posts: 44
Joined: Sun Nov 16, 2008 7:12 pm

Re: Remove article id from url for joomla 3.0

Postby rgblogs » Sun May 01, 2016 4:27 pm

This problem of Joomla is very old, and still no easy solution :(
Ask Me For Any Professional Joomla Help!

lpgratton
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 15, 2010 11:00 am

Re: Remove article id from url for joomla 3.0

Postby lpgratton » Sun May 01, 2016 4:34 pm

I believe the best solution for now is to use Sefwizard:

http://extensions.joomla.org/extension/ ... for-joomla

It works perfectly well, and eliminates the problems mentioned above.

User avatar
Josh Lewis
Joomla! Guru
Joomla! Guru
Posts: 528
Joined: Wed Jun 11, 2008 11:12 pm
Location: Lynnwood,WA
Contact:

Re: Remove article id from url for joomla 3.0

Postby Josh Lewis » Tue May 03, 2016 5:19 pm

lpgratton wrote:I believe the best solution for now is to use Sefwizard:


Already mentioned on this very page of the thread: viewtopic.php?p=3372055&sid=9ced062f6a92db3c0a9ef61522c2a2fa#p3372055

;)

lpgratton
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Apr 15, 2010 11:00 am

Re: Remove article id from url for joomla 3.0

Postby lpgratton » Tue May 03, 2016 9:13 pm

I know, Josh: you mentioned it, and i've tried it successfully.

My point was to confirm that it works very well and that it solves the two problems described above.

User avatar
Josh Lewis
Joomla! Guru
Joomla! Guru
Posts: 528
Joined: Wed Jun 11, 2008 11:12 pm
Location: Lynnwood,WA
Contact:

Re: Remove article id from url for joomla 3.0

Postby Josh Lewis » Sat May 07, 2016 3:55 am

We need testers for the PR to remove id's from article URL's: https://issues.joomla.org/tracker/joomla-cms/10170

It's about time this gets taken care of for Joomla. :D

webdesco
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Wed Oct 07, 2009 12:21 pm

Re: Remove article id from url for joomla 3.0

Postby webdesco » Tue Jul 26, 2016 9:39 am

correct me if I'm wrong, but, Joomla 3.6 has been released and they still have not fixed the problem. Thankfully sefWizard still works in 3.6


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

Who is online

Users browsing this forum: No registered users and 1 guest