Closed sardoj closed 2 years ago
When you configure several domains on Laravel Forge (1 primary domain and several aliases), the package always detect the primary domain.
An easy solution is to update src/Foundation/DomainDetector.php (line 59) as following:
src/Foundation/DomainDetector.php
Replace return Arr::get($_SERVER,'SERVER_NAME');
return Arr::get($_SERVER,'SERVER_NAME');
By return Arr::get($_SERVER,'HTTP_HOST');
return Arr::get($_SERVER,'HTTP_HOST');
Hi,
the HTTP_HOST variable has some disadvantages with respect to SERVER_NAME as pointed out for example in #41.
However, if you follow the docs, you can customize the detection of the domain passing a closure to the application, as described here.
Cheers
Giacomo
When you configure several domains on Laravel Forge (1 primary domain and several aliases), the package always detect the primary domain.
An easy solution is to update
src/Foundation/DomainDetector.php
(line 59) as following:Replace
return Arr::get($_SERVER,'SERVER_NAME');
By
return Arr::get($_SERVER,'HTTP_HOST');