Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it

1.7k Views Asked by At

in order to have the locale prefix at the beginning of the url instead of the end of the url, i have set in "admin/config/regional/language/detection/url" the part of the url that determines language to domain. english: en.mysite.localhost francais: fr.mysite.localhost But when I try to delete the translation "fr" of a node Article en.mysite.localhost/node/7/delete I have an issue and the current error: “Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.” Someone knows how to work around the problem? I have tried to edit the settings.php and set trusted_host_patterns to ['.*'] but not working. I noticed also that with this configuration, the cookie of the admin loggeed in en.mysite.localhost is not the same with the cookie of the admin logged in fr.mysite.localhost and so not able to switch between 2 languages with the same cookie, i have to logg twice. maybe this configuration with the language detection by domain is not the good thing for my needs (get the locale prefix at the beguinning of the url) Thanks in advance for your help.

0

There are 0 best solutions below