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!
Labels |
Added:
?
|
Labels |
Added:
J4 Issue
|
Title |
|
Title |
|
Can a Developer please answer as this Issue is unanswered since one Day?
Status | New | ⇒ | Information Required |
@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?
@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?
New Features goes in J4. J3 get Bug fixing.
@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.
I would like to see this in j4, that could make com_redirect useful for me.
@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.
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
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-02-03 19:23:09 |
Closed_By | ⇒ | alikon |
Status | Closed | ⇒ | New |
Closed_Date | 2020-02-03 19:23:09 | ⇒ | |
Closed_By | alikon | ⇒ |
sure,
but not blindly closing issues, only different approach
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?
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.
Labels |
Added:
?
No Code Attached Yet
Removed: ? |
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).