You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.
To handle redirects from URL's with an ID to url's without an ID, create a redirect plugin that intercepts the 404 error and then tries to calculate the URL without ID from the URL with id.
For the handling of the URL, build a regex that strips the ID's from the URL and then redirect to the URL again. ID's to be stripped always follow the "/xxx-" format, where xxx is a number. If no /xxx- can be found in the url assume it's no id url and don't try to re-direct it, just handle the error as normal.
Nice to have's
Write the redirects to file in a format supported by nginx. Each time a new redirect is found add it to the file. Then we can load this file into nginx and have the server handle the redirects if he knows about them.
The text was updated successfully, but these errors were encountered:
@allanpilarca We have included a 404 redirect plugin in TEXTman too. This plugin only includes support for com_content @ercanozkaya approached it slighly different. Can you review his code and see if it it includes any potential improvements you can make?
To handle redirects from URL's with an ID to url's without an ID, create a redirect plugin that intercepts the 404 error and then tries to calculate the URL without ID from the URL with id.
For an example how to intercept 404 errors see: https://github.com/joomla/joomla-cms/blob/staging/plugins/system/redirect/redirect.php#L107
For the handling of the URL, build a regex that strips the ID's from the URL and then redirect to the URL again. ID's to be stripped always follow the "/xxx-" format, where xxx is a number. If no /xxx- can be found in the url assume it's no id url and don't try to re-direct it, just handle the error as normal.
Nice to have's
The text was updated successfully, but these errors were encountered: