[PHP] Як дозволити доступ тільки до декількох доменних імен?

Written by  Thursday, 08 January 2015 06:39
$allowed_hosts = array('foo.example.com', 'bar.example.com');
if (!isset($_SERVER['HTTP_HOST']) || !in_array($_SERVER['HTTP_HOST'], $allowed_hosts)) {
    header($_SERVER['SERVER_PROTOCOL'].' 400 Bad Request');
    exit;
}
678 Read Last modified on Sunday, 09 July 2017

Leave a comment

Make sure you enter all the required information, indicated by an asterisk (*). HTML code is not allowed.

5 comments

  • Comment Link ultra boost Saturday, 17 February 2018 04:24 ultra boost

    I'm also commenting to make you be aware of what a nice encounter my cousin's girl undergone going through your webblog. She learned several issues, which include what it is like to possess an awesome giving style to get certain people without difficulty know precisely specific complicated things. You undoubtedly exceeded people's expectations. I appreciate you for delivering such powerful, trusted, explanatory and even fun guidance on that topic to Gloria.

  • Comment Link real jordans for sale cheap Monday, 19 February 2018 14:14 real jordans for sale cheap

    I discovered your blog website on google and verify just a few of your early posts. Proceed to keep up the excellent operate. I simply extra up your RSS feed to my MSN News Reader. Seeking forward to reading extra from you afterward!?

  • Comment Link yeezy Saturday, 24 February 2018 01:15 yeezy

    Thank you so much for providing individuals with an exceptionally superb opportunity to discover important secrets from this web site. It is always very awesome plus stuffed with a good time for me personally and my office acquaintances to visit your blog a minimum of thrice in a week to read the fresh guidance you have got. And indeed, I'm so usually amazed concerning the beautiful thoughts you give. Certain 4 tips in this posting are undoubtedly the most effective I have had.

  • Comment Link nike free run Thursday, 01 March 2018 19:45 nike free run

    I抦 impressed, I have to say. Actually not often do I encounter a weblog that抯 both educative and entertaining, and let me tell you, you will have hit the nail on the head. Your idea is outstanding; the problem is one thing that not enough people are talking intelligently about. I am very pleased that I stumbled across this in my seek for one thing regarding this.

  • Comment Link adidas nmd runner Tuesday, 06 March 2018 01:39 adidas nmd runner

    I not to mention my friends came looking at the best recommendations located on your web page while the sudden I got an awful feeling I never expressed respect to the web blog owner for those tips. The people are already absolutely happy to learn all of them and already have truly been having fun with those things. Many thanks for really being quite considerate and for figuring out some really good information millions of individuals are really needing to be aware of. My honest regret for not expressing appreciation to earlier.