-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Multi-site setup issues #241
Comments
Probably you need to use Entry Redirects URL Match Type set to Full URL |
@khalwat Thanks for the response. When creating a new rule from the 404 dashboard, neither are respected, right? Neither the mentioned setting, nor the site url. How to make this more convenient for the non-technical users? |
Right, perhaps that should be set as the default for new redirects that are manually created too? |
Sounds good |
For anybody interested. I was able to resolve our setup with the following Event: Event::on(Redirects::class, Redirects::EVENT_BEFORE_RESOLVE_REDIRECT, function (ResolveRedirectEvent $event) {
$site = \Craft::$app->getSites()->currentSite;
$redirects = Retour::$plugin->redirects->getAllStaticRedirects(null, $site->id);
foreach ($redirects as $redirect) {
if ($redirect['redirectMatchType'] !== 'exactmatch') {
continue;
}
if ($redirect['redirectSrcMatch'] !== 'pathonly') {
continue;
}
$urlToMatch = rtrim($site->baseUrl, '/') . '/' . ltrim($redirect['redirectSrcUrlParsed'], '/');
if ($event->fullUrl !== $urlToMatch) {
continue;
}
$redirectUrl = rtrim($site->baseUrl, '/') . '/' . ltrim($redirect['redirectDestUrl'], '/');
$event->redirectDestUrl = $redirectUrl;
break;
}
}); |
Ah let me re-open this so I don't miss putting the change in mentioned above. |
Question
I am trying to get the plugin working with my multi-site setup. We have 6 different sites, with 2 different domains and 2 languages.
This is working (RegEx).
But when I auto generate redirects "when entry urls change", it's generated like this.
This is not working, because it doesn't respect the site path.
If I change it manually to this, it is working again.
Am I missing something in my setup? Would it be possible, to allow configuring "exactmatch" to "regexmatch" for auto generated redirects?
The text was updated successfully, but these errors were encountered: