Support » Fixing WordPress » translating server IP address

  • I set up my MU install on a server IP address while redesigning and migrating an existing site. Once the redesign/migration was completed, I made the appropriate changes to server, DNS, and database to enable the new WordPress MU site.

    Here’s the problem… there are several entries in the Google search index that point at the original IP address pages (i.e., ) that I’d like to point to the new appropriate page. (The domain should be When you click on the ip address link, it goes instead to the home page of the MU install.

    Is there a way to force the IP address to translate to the domain on the fly, so I don’t lose these search result links?

Viewing 5 replies - 1 through 5 (of 5 total)
  • PHP can do this. Just catch the URL, replace the IP with the DNS and make a header redirect with the appropriate code (something like 301… google it).

    That is if the new page using the same path after the IP… hope it’s the case for you! 😉

    Thanks for the reply, Blirette.

    By “catch the URL” do you mean using htaccess? Because with the htaccess accompanying the WordPress install, by the time the browser gets to a php page the extra URL stuff has already been stripped out.

    Check this out :

    You’ll have to use something in here (maybe $_SERVER[‘REQUEST_URL’]) to get the URL. Check in it if you see your IP with something like :

    $pos = strpos($mystring, $findme);

    If it’s a go, redirect to the other URL :


    Get the idea?

    I understand how that works. Unfortunately, in the order of operations the browser request first passes through .htaccess before getting to a PHP page, and .htaccess itself redirects (and reformats) the IP-URL to the home page of the blog.

    I guess what I’m trying to nail down is a .htaccess oriented solution.

    If every IP requests links to the homepage of the MU install, you just have to put this PHP code on that page.

    … or via htaccess, but I personnaly don’t like to use that trick.

    Anyway, hope it works for you!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘translating server IP address’ is closed to new replies.