Redirect old URLs with Numbered IDs

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.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
Londinium
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Tue Sep 18, 2007 9:21 pm

Redirect old URLs with Numbered IDs

Post by Londinium » Sun Sep 02, 2018 9:50 am

Hi everyone,

I have searched the forum, but I still haven't found the optimal answer for the following question:

In a Joomla-based website with thousands of articles, how do we redirect the old numbered ID URLs to the new routing system?

In other words, how do we get from:

example.com/567-an-old-article-written-in-2012

to

example.com/an-old-article-written-in-2012


Does Joomla's new routing system take care of the job?
Should we do it ourselves via the Redirect Component?
Should we add an instruction to .htaccess? Which one?
Should we install a plugin that does the work?

I would really appreciate your thoughts, as I am struggling to move 14,000 articles with IDs to the new URL system. ;)

Thank you very much,

Cheers,

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

Re: Redirect old URLs with Numbered IDs

Post by Per Yngve Berg » Sun Sep 02, 2018 4:19 pm

Code in .htaccess to remove id number.

Code: Select all

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

Londinium
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Tue Sep 18, 2007 9:21 pm

Re: Redirect old URLs with Numbered IDs

Post by Londinium » Thu Sep 06, 2018 8:58 am

Thank you very much for your feedback, Per.

I believe this is a much better solution than just using the Redirect component tool, right?

Cheers,

devonolivier
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Oct 12, 2018 5:22 pm

Re: Redirect old URLs with Numbered IDs

Post by devonolivier » Fri Oct 12, 2018 5:25 pm

For everyone still interested in this problem i've just found a plugin doing the auto redirection to the new url without IDs... looks great but i've not tried it

https://extensions.joomla.org/extension/jredirects/
Last edited by toivo on Mon Oct 22, 2018 11:15 am, edited 1 time in total.
Reason: mod note: changed the link to point to JED - please read the forum rules at https://forum.joomla.org/viewtopic.php?f=8&t=65


Locked

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