-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent duplicate rules #82
Comments
+1 to this- we've had a couple flaky redirections due to this issue. |
No? Nothing? @johngodley ? |
@galbaras This plugin doesn't seem to get much love- which is sad 😦 |
OK, so I've just given it some love (good review, that is). With 500,000+ installs, I think it's worth the investment. Come to think of it, features like a better bulk upload interface and automatic renaming of all posts types, all uploads, all taxonomies and all terms would make this plugin truly remarkable and worth all the love in the world :) |
I don't think it's necessary while adding a redirect manually (I use always the search feature). |
+1 |
So this rule checker could run as it's own batch job. I don't think it needs to correct the issues in the first version, just highlight then.
First version could just do literal match. |
I'm trying to implement this for a client that needs it ASAP. Is this a reliable way of checking if an URL has a matching redirect? It's basically a copy of redirection/modules/wordpress.php Line 312 in 0ae8631
public function getMatchingItem(string $url): ?Red_Item
{
$request = new Red_Url_Request($url);
// Make sure we don't try and redirect something essential
if (! $request->is_valid() || $request->is_protected_url()) {
return null;
}
// Get all redirects that match the URL
$redirects = Red_Item::get_for_url($request->get_decoded_url());
// Redirects will be ordered by position. Run through the list until one fires
foreach ($redirects as $item) {
$action = $item->get_match($request->get_decoded_url(), $request->get_original_url());
if ($action) {
return $item;
}
}
return null;
} |
Just want to give this a +1 as well. Detection of redirect loops would be super helpful when importing a large number of redirects. It would also be helpful for clients who may not have enough knowledge regarding redirection loops. I think the steps laid out by @XVII are a great place to start. |
It would be great to be able to find duplicate rules and/or flagging them when they are added.
To me a duplicate rule is anything with the same source URL, but a possibly duplicate rule is anything with a string of X characters in common, with X best implemented as a configurable setting.
The text was updated successfully, but these errors were encountered: