By lionsea on
Hi, I think this is related to Drupal's core upgrading and migrating issues, but this issue happened when I finish upgrading Drupal at dev environment and then migrated it to the prod site, so I post this question here.
related issue is discussed here from Nov 2015.
Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.and to fix this issue, eveyone says like below
# New Line
SetEnv DRUPAL_WEBROOT /web
# Existing Lines
RewriteCond %{REQUEST_URI} !^/web/
RewriteRule ^(.*)$ /web/$1 [L,QSA]
use Drupal\Core\Runtime\DrupalRuntime;
$webroot = getenv('DRUPAL_WEBROOT');
if ($webroot !== FALSE && str_starts_with($_SERVER['SCRIPT_NAME'], $webroot)) {
$_SERVER['SCRIPT_NAME'] = substr($webroot !== FALSE && $_SERVER['SCRIPT_NAME'], strlen($webroot));
}
// By default, the symfony/runtime component would load SymfonyRuntime as its
// runtime. However, Drupal's Kernel has a lot of runtime components that it
// expects to be prepared. Thus, we default Drupal applications to DrupalRuntime
// instead to make this easily accessible.
$_ENV['APP_RUNTIME'] ??= $_SERVER['APP_RUNTIME'] ?? DrupalRuntime::class;
return require __DIR__ . '/../vendor/autoload_runtime.php';and this doesn't work for me.
Any advise? drupal11.4.4
Comments
solved.
solved.