Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

[SOLVED]How to make my Phalcon folder accessible by many virtual hosts?

Dear experts,

How to make my Phalcon folder accessible by many virtual hosts?

I want to point my domain1.com, domain2.com, domain3.com point to the same my application (Phalcon) folder, but in config.php, I was only able to set single 'baseUri'=> 'http://domain1.com'. It was keeping redirect to domain1.com when I access to domain2.com.

Thank you

Jim



1.2k
Accepted
answer

what if

$config = array(
// ...
    'baseUri' => 'http://' . rtrim(strtolower($_SERVER['HTTP_HOST']), '.'),
);

?

@Vladimir That's beautiful.

Thanks a lot. You're best :)



61

@Jimmy, Please do sanitize that SERVER variable. It can't be trusted! http://stackoverflow.com/questions/6474783/which-server-variables-are-safe