Relative vs. absolute href links
-
I’m pretty new to WP, but not to php and programming. I’m bringing up a site that currently uses the “widescreen” template from Graphpaper Press – which uses the new 3.0 menu system.
I need to point more than one domain address to the same WP site instance, and to have the site behave a little differently (e.g. hide the “Contact” page) depending which domain was used. It’s easy to test <?php $_SERVER[SERVER_NAME]; ?> to find out what domain the client’s browser requested, but then the behavior of the menu system gets in the way.
The href’s in the menu links appear to always be relative to “Settings (-> General) -> WordPress Adress” in the admin menu (probably via bloginfo(‘siteurl’)…). That is, the menu gives absolute links based on the web address in the Settings. This means that no matter which $_SERVER[SERVER_NAME] was specified by the client browser, as soon as they’ve clicked a link I’ve lost original domain address and started using the one from Settings.
Have I overlooked some functionality that would let me do what I’ve described? If I need to hack WP, I’d appreciate any tips on how to do it with minimal collateral damage. (I am using git; I’m generally in a good position to manage updates while preserving hacks).
Thanks!
John
- The topic ‘Relative vs. absolute href links’ is closed to new replies.