Setting conditions based on inbound URL
Permalinkdomain.com : should have all links from the primary auto nav
domain2.com : should have all but two links from the primary auto nav (for purposes of example, let's say /blog, and /contact).
So, if I visit domain2.com, I see all the same content, minus "/blog" where my client wishes his blog wasn't visible to the audience arriving from a vanity domain name.
I'm thinking I can add an if/else in my default.php template that checks the inbound URL, maybe with something like HTTP_REFERER? Then maybe some CSS that hides the link based on page handle or ID? Any ideas or recommendations on how to handle this?
Thanks,
Zach

I use Plesk, and was going to do a frame forward from domain2.com, but even just testing with the IP address flips right over to domain.com. Any other ideas on how to handle this?
define('REDIRECT_TO_BASE_URL', false);
...but I'm not sure if there are other negative side-effects to doing that -- maybe clicking links to other pages of the site will subsequently bring them to the other domain?
Another idea is to "short-circuit" the BASE_URL redirect thing by adding a rewrite rule to your .htaccess file which looks for that one domain name and appends an argument to the querystring if it's found -- so your code would look for that querystring arg instead of the domain name itself. This would also present the problem of subsequent link clicks going to the wrong domain name. Although I suppose you could set a session cookie or something.
Finally, if this is a client project and you have a budget, you might want to check out the "Domain Mapper" addon in the marketplace -- it's pricey but I believe it does what you're wanting.
One thing I'm considering is to set up an alternative nav. Do you have any advice on how to handle this? I could hardcode and include one, but won't get the nice auto nav features and would obviously create update headaches down the road.
I was thinking something like:
if ($_SERVER['HTTP_REFERER'] == 'http://domain2.com/') { $a = new Area('Alternate Nav'); } else { $a = new Area('Header Nav'); }
Or, I found a thread here:http://www.concrete5.org/community/forums/customizing_c5/header-nav... that suggests I could add an attribute for each page. So, I could add an "exclude from alternate nav" option. I'm still pretty new to C5 and just not sure what the best practice would be. Any ideas? Thanks in advance.
This means you have two choices really:
1) Set up an alternate section of the site and tell the autonav to show pages in that section.
2) Manually tell the autonav which pages you want to be included in it.
Logically, there's no other option here -- you're either having it automatically show pages in a section of the site or you're not doing that (in which case you need to tell it which to show).
So creating a new attribute is one way to "manually choose" the pages. Another option is to use a free addon I've made called "Manual Nav" which lets you choose the pages to be included when you add the block. Note that this addon is for designers and as such it is unstyled (requires you to style it with CSS). There are other addons in the marketplace that cost money which function similarly but come with pre-set styles.
Hope that helps.