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.
Hi @lionsea,
Hi @lionsea,
Could you please tell me how you solved this? I've tried following the relevant threads on this topic, but there are so many unsuccessful attempts that I can't figure out which one might be the right one.
Since I'm currently unable to change the docroot on the host, this is the only option I have.
Thanks, if you can
Those solutions posted at the
Those solutions posted at the issue page is for Drupal11.4 and above, if you are not running that, find another solutions like editing settings.php.
I just did change .htaccess file of my web root( not /web/.htaccess file) adding the line below and adding
NEW WORKAROUNDto/web/autoload_runtime.php: see #106 and #138.SetEnv DRUPAL_WEBROOT /dp11_public
If you still fail, you would want to ask at the issue page.