I have two projects under the same domain:
- The project #1 is a website made with PHP 5.4 and is not running on any CMS.
- The project #2 is a Drupal 8.x to where I'll migrate URL-paths of the project #1.
The structure of my document root is:
/var/www/domain-name.com/
/var/www/domain-name.com/project-1/web/
/var/www/domain-name.com/project-2/web/
Here is my vhost apache file:
<VirtualHost *:443>
ServerName domain-name.com
ServerAlias www.domain-name.com
DocumentRoot /var/www/domain-name.com
<Directory "/var/www/domain-name.com/">
RewriteEngine on
# Any URL-path that not matched use the project #1
RewriteCond %{REQUEST_URI} !^(user|admin|ece|membersgetmembers) [NC]
RewriteRule (.*) "/var/www/domain-name.com/project-1/web/$1"
# Any URL-path that matches use the project #2 (Drupal)
RewriteCond %{REQUEST_URI} ^/(user|admin|ece|membersgetmembers) [NC]
RewriteRule ^(user|admin|ece|membersgetmembers)(/|$)(.*) /var/www/domain-name.com/project-2/web/$1$2$3
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9000"
</FilesMatch>
<Directory "/var/www/domain-name.com/project-1/web/">
RewriteBase /var/www/domain-name.com/project-2/web
AllowOverride All
Require all granted
<FilesMatch \.php$>
SetHandler "proxy:fcgi://127.0.0.1:9002"
</FilesMatch>
</Directory>
<Directory "/var/www/domain-name.com/project-2/web/">
RewriteBase /var/www/domain-name.com/project-2/web
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
But when I visit URL of the project #2 (the Drupal) ex.: https://domain-name.com/user/login I receive this error message:
Redirects to external URLs are not allowed by default, use \Drupal\Core\Routing\TrustedRedirectResponse for it.
How can I solve this issue? Thanks for any help and sorry for my english.