Page 1 of 1

Remove article id from url for joomla 3.0 gives 404

Posted: Sun Nov 18, 2018 8:31 pm
by agilalberdi
Hi,

We have change the versión of the Joomla platform, from 2.5 to 3.8. On the new one we were able to remove the ID from the URLs, but the problem is that we have a lot of URLs indexed with the ID included. And all of those URLs are giving us a lot of 404.

Indexed URLs
http://www.eexcellence.es/index.php/bib ... w-y-linsky

Actual One
http://www.eexcellence.es/index.php/bib ... w-y-linsky

Can I do something?, do you suggest me anything?

Thanks

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Mon Nov 19, 2018 8:57 pm
by Alejo
Hi,

My suggestion would be to create an .htaccess rule that redirects to the no-ID version of the URL.

Something like this:

Code: Select all

RewriteRule ^biblioteca-empresarial/([0-9].*)-(.*) http://www.eexcellence.es/index.php/biblioteca-empresarial/$2 [R=301,L]
Suerte!

Alejandro

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Tue Nov 20, 2018 7:02 am
by zagrox
In current version of joomla this will be fixed very easy by clicking on article options and in integration advanced just change the route to modern and done

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Tue Nov 20, 2018 2:09 pm
by kiasati
If it's not broken, don't fix it!

but you have done it and Google has indexed them. so you can just turn it back to have the id in the URL as before.
You better redirect all of them with one rule without any error. it depends on the number of pages.

your ranking might get a hit, but it will be OK after a while.

but you must fix the 404 problems as soon as possible.

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Tue Nov 20, 2018 2:35 pm
by agilalberdi
zagrox wrote:
Tue Nov 20, 2018 7:02 am
In current version of joomla this will be fixed very easy by clicking on article options and in integration advanced just change the route to modern and done
Hi zagros, this is what we have done for the new versión but we have a lot of the OLD URLs with the ID that are allready indexed. Thanks for your answer

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Tue Nov 20, 2018 2:37 pm
by agilalberdi
kiasati wrote:
Tue Nov 20, 2018 2:09 pm
If it's not broken, don't fix it!

but you have done it and Google has indexed them. so you can just turn it back to have the id in the URL as before.
You better redirect all of them with one rule without any error. it depends on the number of pages.

your ranking might get a hit, but it will be OK after a while.

but you must fix the 404 problems as soon as possible.
Thanks Kiasati, wat I do not know is the code to fix it. I have tried somes but do not fixed it. Thanks

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Tue Nov 20, 2018 2:44 pm
by Alejo
@agilalberdi: with the approach I suggested you would need to add one redirect line for each of your categories. Basically, anything with the format:

/category/id-article-alias

If you have subcategories, then you would need to extend the approach. So for example, if you had a subcategory with a menu before, the URL looked like this:

/category/subcategory/id-article-alias

The redirect would be:

Code: Select all

RewriteRule ^category/subcategory/([0-9].*)-(.*) http://www.eexcellence.es/index.php/category/subcategory/$2 [R=301,L]
Unless you have thousands of categories, the approach should be manageable. And even if you have hundreds its doable. The other solution is for you to write your own redirect script that handles this automatically.

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Tue Nov 20, 2018 2:56 pm
by agilalberdi
http://www.eexcellence.es/index.php/bib ... d-p-norton

Thanks, I will do it as you said. But with the URLs with only one word is working but in someones like this It is giving me

http://www.eexcellence.es/index.php/bib ... ial/norton

Instead of

http://www.eexcellence.es/index.php/bib ... d-p-norton

The sentence I place it is, as without the index.php is not working

RewriteRule ^index.php/biblioteca-empresarial/([0-9].*)-(.*) http://www.eexcellence.es/index.php/bib ... esarial/$2 [R=301,L]

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Tue Nov 20, 2018 4:26 pm
by Alejo
Try this:

Code: Select all

RewriteRule ^biblioteca-empresarial/([0-9]+)-(.*) http://www.eexcellence.es/index.php/biblioteca-empresarial/$2 [R=301,L]
And clear your browser cache because previous redirects my be cached in the browser and the new rule will not work if you try with the same URLs you tested before.

Re: Remove article id from url for joomla 3.0 gives 404

Posted: Wed Nov 21, 2018 6:22 pm
by agilalberdi
Alejo wrote:
Tue Nov 20, 2018 4:26 pm
Try this:

Code: Select all

RewriteRule ^biblioteca-empresarial/([0-9]+)-(.*) http://www.eexcellence.es/index.php/biblioteca-empresarial/$2 [R=301,L]
And clear your browser cache because previous redirects my be cached in the browser and the new rule will not work if you try with the same URLs you tested before.
Thanks Alejo, It is working perfect.