? No Code Attached Yet J4 Issue
avatar Gnevyshev
Gnevyshev
16 Apr 2019

As far as I understand, now Redirects Manager does not allow to use regular expressions in the field "Expired URL".
But it would be very useful!
Now, for example, if I renamed the category on the site, then for each old pagination page I need to manually configure individual redirect. If regular expressions could be used, this could all be done in a single action.
Thanks in advance!

avatar Gnevyshev Gnevyshev - open - 16 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 16 Apr 2019
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 16 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Apr 2019
Labels Added: J4 Issue
avatar franz-wohlkoenig franz-wohlkoenig - labeled - 16 Apr 2019
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Apr 2019
Title
Regular expressions in the Redirects Manager
[4.0] Regular expressions in the Redirects Manager
avatar franz-wohlkoenig franz-wohlkoenig - change - 16 Apr 2019
Title
Regular expressions in the Redirects Manager
[4.0] Regular expressions in the Redirects Manager
avatar franz-wohlkoenig franz-wohlkoenig - edited - 16 Apr 2019
avatar Gnevyshev
Gnevyshev - comment - 16 Apr 2019

In addition, it will help to reduce the number of redirects. So the site will work faster. For example, 100 redirects with regular expressions, I think, will work faster than 2000-3000 single redirects (similar to each other).

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Apr 2019

Can a Developer please answer as this Issue is unanswered since one Day?

avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Apr 2019
Status New Information Required
avatar richard67
richard67 - comment - 17 Apr 2019

@Gnevyshev Do I understand you right that it would be sufficient for you if the matching condition for the expired URL would be a regular expression, but the new URL would be constant? Or do you also need to use placeholders in the new URL for matches in the regular expression like it would be possible with a regex_replace function?

avatar Gnevyshev
Gnevyshev - comment - 17 Apr 2019

@richard67
For now, it would be enough for me to use regular expressions only for the Expired URL. But if it could be done for a New URL, I think it would be very useful in a number of cases.
Thank you!
And is it possible to do it for Joomla 3, not only for Joomla 4?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Apr 2019

New Features goes in J4. J3 get Bug fixing.

avatar richard67
richard67 - comment - 21 Apr 2019

@Gnevyshev Well I just asked for details about your requirements in order to make your issue more clear to other readers. But that does not mean that I would like to implement it. In fact I am ok with com_redirect as it is. Stuff where I need regular expressions and wildcards I do in .htaccess file.

avatar HLeithner
HLeithner - comment - 22 Apr 2019

I would like to see this in j4, that could make com_redirect useful for me.

avatar Gnevyshev
Gnevyshev - comment - 22 Apr 2019

@richard67
Earlier I used to use .htaccess too.
But when many thousand lines accumulated in it, then it stopped working )
But php processing copes well with this.
Therefore, I began to use com_redirect.
And it would be even more useful if it could use regular expressions.

avatar alikon
alikon - comment - 3 Feb 2020

Closing this due to not receiving required information to determine if this is a bug or not. If you feel this still needs review, please open a new tracker entry with as much information as possible to ensure it can be reviewed properly

avatar alikon alikon - change - 3 Feb 2020
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2020-02-03 19:23:09
Closed_By alikon
avatar alikon alikon - close - 3 Feb 2020
avatar brianteeman
brianteeman - comment - 3 Feb 2020

@alikon - please STOP blindly closing issues. This was a feature request not a bug report. There was no required information missing.

avatar brianteeman brianteeman - change - 3 Feb 2020
Status Closed New
Closed_Date 2020-02-03 19:23:09
Closed_By alikon
avatar brianteeman brianteeman - reopen - 3 Feb 2020
avatar alikon
alikon - comment - 3 Feb 2020

sure,
but not blindly closing issues, only different approach

avatar ceford
ceford - comment - 27 Oct 2020

The redirect plugin works by intercepting a 404 event and then trying to find a matching url in the redirects table. So the only use for a regular expression would be to populate the table. I don't see how to do that using a regular expression. You actually need a list of the broken urls. With that you could generate a redirect list externally and use the Redirect component Bulk import feature. I guess a separate plugin with higher priority might work - at the risk of an endless redirect loop.

Could the original poster provide an example of the regular expressions used in the .htaccess redirects?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/24600.

avatar alkisg
alkisg - comment - 25 Apr 2022

An example use case would be to redirect /wiki/<anypage> to /docs/<anypage>.
I ended up using Apache's RedirectMatch directive; the aforementioned example could be written as:

RedirectMatch 301 "^/wiki/(.*)" "/docs/$1"

The implementation could use PHP's preg_replace() function.

avatar Quy Quy - change - 16 Feb 2023
Labels Added: ? No Code Attached Yet
Removed: ?
avatar Quy Quy - labeled - 16 Feb 2023

Add a Comment

Login with GitHub to post a comment