Title: changing output based on http_host?
Last modified: April 1, 2017

---

# changing output based on http_host?

 *  Resolved [chadrt](https://wordpress.org/support/users/chadrt/)
 * (@chadrt)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/changing-output-based-on-http_host/)
 * So I am trying to do something like this…
 *     ```
       ?php 
       switch($_SERVER['HTTP_HOST']) {
           case 'wahsingtonbasedsite.com':
           case 'www.washingtonbasedsite.com':
               echo 'WASHINGTON PHONE NUMBER';
           break;
           case 'idahobasedsite.com':
           case 'www.idahobasedsite.com':
               echo 'IDAHO PHONE NUMBER';
           break;
           default:
               echo 'DEFAULT PHONE NUMBER';
           break;
   
       ?>
       ```
   
 * But all I keep getting is nothing shown, if anyone has any ideas that would superb.
   Thank you for your time!
 * Chad

Viewing 1 replies (of 1 total)

 *  Thread Starter [chadrt](https://wordpress.org/support/users/chadrt/)
 * (@chadrt)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/changing-output-based-on-http_host/#post-8982834)
 * WOW, rookie mistake, I feel stupid now!! It is missing the closing “}” ok time
   to go watch TV and come back my site building when my eyes aren’t acting blind.
   I sure wish I could delete this post to save myself the embarrassment LOL

Viewing 1 replies (of 1 total)

The topic ‘changing output based on http_host?’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/php-code-for-posts_0d1022.svg)
 * [PHP Code for posts](https://wordpress.org/plugins/php-code-for-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/php-code-for-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/php-code-for-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/php-code-for-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/php-code-for-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/php-code-for-posts/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [chadrt](https://wordpress.org/support/users/chadrt/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/changing-output-based-on-http_host/#post-8982834)
 * Status: resolved