I'm using shared hosting with Cyberwurx, and I have two different IP addresses from them.

How can I redirect the traffic from either of those IP addresses to a different, third IP address?

On the third IP, I'll have a script running which gives each site it's custom content. But when you do a whois check on each of my two sites, they would have different IP addresses.

migrated from stackoverflow.com Mar 8 '11 at 23:54

This question came from our site for professional and enthusiast programmers.

  • 2
    "I have two different c class ip's" --- No you don't. You have two IP addresses. Classful routing was abandoned some time ago. What you might mean, is you have two IP addresses from a /24 netblock. – Tom O'Connor Mar 9 '11 at 0:00
  • 1
    I'm confused as to why you'd want to do this.. Unless you're trying to disguise a content or linkfarm from search engines. – Tom O'Connor Mar 9 '11 at 0:01
  • @Tom - thanks for the edit, I was just about to make somethign similar – Mark Henderson Mar 9 '11 at 0:05

The host doesn't matter, unless they don't provide you the tools to do what you need to, but for purposes of your question, it's not really relevant.

I'm not sure your approach is correct for what you are trying to do. If I understand correctly, you want someone that types in www.yoursiteA.com, and someone that types in www.yoursiteB.com, both to go to the same IP address, and handle what content they see based on the URL they typed. You can do that all with one IP address. You can run virtual hosts, so one webserver can serve up multiple websites on the same IP address.

If you can elaborate a bit on what you are trying to do, and confirm that my guess is accurate or not, I might be able to provide more detailed assistance.

  • True, but the whole point is for seo... to have different ips for my sites and still point them to the same host. Google would see my sites different, and that's another seo story, very controversal:) – webmasters Mar 8 '11 at 19:03
  • Ah, gotcha. Well, you need services running at each IP then. The DNS record for site A would point to IP1, the DNS record for site B would point to IP2, and as long as there are servers listening on port 80 at those IP's (or 443 if you are using https), you can do HTTP redirect to IP3. That's could be messy though depending on your implementation. I would avoid doing it that way. Browsers might throw up flags at the redirect, which is a poor user experience. You might run into trouble maintaining state at IP3 (you'd need to track in a cookie / database which site they came from, etc). – David Mar 8 '11 at 19:21
  • Http redirect would also redirect google's link juices I think, so i'm better with not starting this at all – webmasters Mar 8 '11 at 19:24
  • 2
    Google does NOT care what your IP address is, nor do they care how many sites are on any one IP address. This is an awful myth that is propagated by awful SEO sites. See something like mattcutts.com/blog/… for details. – devicenull Mar 9 '11 at 0:06

If i understand correctly you want to host multiple site each with their own IP address on one server? If so simply bind each website to a specific IP address in apache or IIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy