Support » Fixing WordPress » Using WordPress with two different IP's.

  • I just installed WordPress through Microsoft’s Web Platform Installer (IIS 7.0/Win Svr 2008 R2), and I have (what I think) is a unique problem.

    The web server I’m using is a “dual” purpose one: serving both our Intranet use as well as Extranet applications. Most PHP based installations we use are on relative URL’s, so we can move between our private IP (faking it, let’s say and our public IP (again, fake: using those apps by just changing the IP and typing the rest of the address the same (, for example.) To prevent network loops, the public IP does not work internally, hence the need for both addresses.

    What would be a sane approach to doing this with WordPress? The intent is allowing my School District to run a simplistic blog for our website, while not hosting it on a webserver our county maintains (they’ve shut off scripting languages for security purposes: for free, we get what we pay for.) The blog would be primarily used to generate an RSS feed for parents/students to follow our news, and to show a RSS Feed on the homepage, with links to WordPress to read further.

    I am using WordPress Bootstrap, a third-party theme not on the WordPress Theme Directory, so I assume getting that to work is 100% my own problem. Let’s take that part out of the equation, and I’ll use the Twenty Twelve theme until I’m sure WordPress is fully functional first.

    Option 1. My thought was to use PHP trickery to get around it on wp-config.php:

    $LAN_PREFIX_LVUSD = '192.168.';
    if(substr($_SERVER['REMOTE_ADDR'], 0, strlen($LAN_PREFIX_LVUSD)) == $LAN_PREFIX_LVUSD) {
    	define('WP_SITEURL','');// The local IP
    } else {
    define('WP_SITEURL',''); // The public IP

    While WordPress still works with this hack, it breaks the Themes and Admin Interface considerably. Clearly, there’s other issues I haven’t considered.

    Option 2. Would it be possible to make two WordPresses on that server that use the same database, but each copy have a different Site/Home URL of each IP Address? Any considerations before doing this/parts of WordPress that will not work at all/other bad ideas? (Other than the obvious of disk space unnecessarily used up for the dual WP installs/theme contents.)

    NOTE: While scripting languages are off the roster, the host server still allows SSI, which combined with JavaScript, gives me barely enough to dynamically redirect users to the right page. I use this to work around accessing apps on this “special” web server as well.

    A possible upside to this approach: set the public one as read only (install Disable Comments) and unable to be signed into (delete the Meta Widget, obscure the wp-admin directory on the public side), while having the private one available for teachers to comment on District News to add on or post corrections to a story. (Again, might be chasing rainbows on the back of a rocket-propelled sloth.)

    Option 3. A superior, much better option I haven’t considered.

    Option 4. I’m nuts, this is a stupid idea.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Using WordPress with two different IP's.’ is closed to new replies.