Support the ongoing development of Laravel.io →
Security Database
Last updated 9 months ago.
0

best way imho is to set it in you server config per virtual host (or htaccess)

for Apache

SetEnv VARIABLE_NAME variable_value

for Nginx

fastcgi_param   VARIABLE_NAME  variable_value;
Last updated 9 months ago.
0

I'm not a htaccess guru so i need to ask this,

how can i set SERVER_NAME as the variable_value?

So if i access domain1.com VARIABLE_NAME to be domain1.com?

And to be wildcard. So i don't need to add 100 domains to htaccess

Thanks

zenry said:

best way imho is to set it in you server config per virtual host (or htaccess)

for Apache

SetEnv VARIABLE_NAME variable_value

for Nginx

fastcgi_param VARIABLE_NAME variable_value;

Last updated 9 months ago.
0

you can always do something like this, though it doesn't make sense in my opinion

boostrap/start.php

$env = $app->detectEnvironment(function() {
    return $_SERVER['SERVER_NAME'] ?: 'local';
});
Last updated 9 months ago.
0
Last updated 9 months ago.
0

Sign in to participate in this thread!

Full Stack Europe

Your banner here too?

tavicu tavicu Joined 31 Jan 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 Laravel.io - All rights reserved.