8

Can anyone help with using J3 redirect component to fix this kind of broken links:

https://www.portal-gestao.com/whatever/whatever/9999-title-of-the-page

To:

https://www.portal-gestao.com/item/9999-title-of-the-page

And this:

http://www.portal-gestao.com/whatever/whatever/itemlist/tag/name-of-the-tag.html

To:

https://www.portal-gestao.com/item/tag/gurus.html

And this:

http://www.portal-gestao.com/whatever/whatever/itemlist/user/9999-name-of-author.html

To: http://www.portal-gestao.com/item/author/3707-name-of-author.html

Thank you so much for helping!

  • what do you mean by whatever/whatever/ in your urls, are they the alias of some menu items? it would be helpful to provide exact uri you are seeing for example /components/com_tags/list/23-tag.html – Nagarjun Jun 5 '15 at 10:34
  • Yes, they used to be before upgdating the menu structure. Example: portal-gestao.com/gestao/carreira/… portal-gestao.com/gestao/carreira/… – Nuno Nogueira Jun 5 '15 at 10:39
  • 1
    So you have removed completely your old menu-structure and now all your old articles are linked from where? Should all accessed by /item/id-article ? J3 redirect won't help you with this. As you will have to create page by page redirects. – FFrewin Jun 5 '15 at 11:48
6

With the below .htaccess rule you can redirect all pages from a url with the pattern of:

https://www.portal-gestao.com/whatever/whatever/9999-title-of-the-page

to a new url of :

https://www.portal-gestao.com/item/9999-title-of-the-page


htaccess:

RewriteEngine On

RewriteCond %{HTTP_HOST} ^www.portal-gestao.com
RewriteRule ^.*/.*/(.*)$ https://www.portal-gestao.com/item/$1 [L,R=301]

But I am not very sure that this is exactly what you want, as something like this will affect all urls of the above pattern (2 dir level deep urls), unless if all your new urls are now like this.

Maybe it would be better to create this same rule, but by specifying exactly the "whatever" names of the old structure, so the url rewriting will affect only those old paths.

e.g.:

RewriteRule ^whatever1/whatever2/(.*)$ https://www.portal-gestao.com/item/$1 

Of course, as @Nehal pointed out, you could consider a SEF extension like SH404SEF, JOOMSEF etc, that will help you deal with your 404 pages (broken links). Most of them provide settings in order to configure how the urls of your website should be built.

  • Yes the 1st rule will redirect everything, that's not what I need. The second seems better. Thank you – Nuno Nogueira Jun 5 '15 at 23:00
3

What you could do is use Joomla's Redirect Manager to redirect the old URL to the new one.

In the Joomla backend, go to:

Components >> Redirect >> New

In the Source URL field, enter the old URL and in the Destination URL field, enter the new URL

  • Yes, I know :-) The thing is how to create the rules above (not page by page) – Nuno Nogueira Jun 5 '15 at 9:59
  • 1
    Ahh...for this you may need to use a redirect extension that has a regex feature or edit your htaccess file. Unfortunately, I'm not a htaccess expert so I can't really help with that. Hopefully someone else can provide you with some insight – Lodder Jun 5 '15 at 10:01
3

You can use JOOMSEF component, which is for SEO purpose and more of this extension is free.

Also in that component you have option to remove category and menu names from url and also you can customize the url according to you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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