address specific variable

He has: 688 posts

Joined: Feb 2001

I used to have two domains that shared the exact same site, and I gave them different design templates depending on the domain name. The following code which I used worked like a charm.

<?
if(preg_match("/domain1\.com/i", $_SERVER["HTTP_HOST"])) {
  $variable = "variable1";
if(preg_match("/domain2\.com/i", $_SERVER["HTTP_HOST"])) {
  $variable = "variable2";
} else {
  $variable = "variable3/";
}
?>
'

I've got a similar but different situation now. This time instead of calling a different header depending on the domain, I need to call a different header depending on an exact address on the same domain. To be more precise, if exact address A (www.domain.com/index.php) then do not add a header. If any other address other than A (www.domain.com/blog/whatever.php) then do add the header file.

The reason I need to do this is for my blog. I use blogger.com but I upload the files and serve them from my own website, which involves customizing the template. Normally I would add a php include to my header and footer in my blogger template, which would work because it ends up getting served from my server. That worked, but now I want to add my main blog to my website's homepage. To do this I have two choices. Choice A is to have my entire homepage in a blogger template. That'll work but becomes a hassle when I need to go through blogger's web forms every time I want to make changes to my homepage. Choice B (what I want to do) is to have my homepage file independent of blogger and make an include call to add the content of the blog. The ONLY problem with this is that I would then need to remove the header and footer calls from my blogger template, but that also removed them from all linked posts, archives, etc. Make sense?