Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm considering starting a website that allows customers to map a domain they own and control, to their page or subdomain in my site. Do I need to have an IP address for each customer domain? Is this something that webhosts will commonly allow me to do?

share|improve this question
up vote 2 down vote accepted

What you're talking about, at least on Apache web server, are called Virtual Hosts. Your customers/clients would simply need to point the A record for their domain at your server's IP address where you have the Virtual Hosts setup.

In your Apache configuration, you'll need to setup a new Virtual Host for each new domain you have coming in, which you can then send to whatever location on your server you desire.

This isn't the place for a full Virtual Hosts tutorial, but there are some good questions here, and there's always the Apache Virtual Host Documentation or the Apache Virtual Host Examples.

share|improve this answer
Thanks Nathan. I'm only exploring possibilities now and this one certainly looks promising. I can't confirm yet that this one works for me, so I wanted to upvote it instead of checking it, however I don't have enough karma to do an upvote. For now, accept my gratitude :) and a promise to either upvote when I earn enough karma or check it once I get it working! – undetected May 9 '13 at 6:57
The more I look into it, the more I find that confirmation on what you've shared, so I've put in the check. Thanks again! – undetected May 11 '13 at 4:23

There's lots of ways to skin a cat here. Just use an .htaccess redirect in the root of their domain:

## 301 Redirect Old File
Redirect 301 / yourdomain.com/somepage.html

Or make a simple index page with a redirect in the header:

<?php header('Location: http://www.example.com/'); ?>

Then place it in the root of their domain.

share|improve this answer
So this means a customer will still need a separate host, they can't just update their registration information similar to an A record? Is this something I could host for multiple customers? Multiple domains pointed to my IP, and use .htaccess or something similar to then send a request to the right page? – undetected Apr 30 '13 at 14:11
Sorry I didn't fully understand the question. Nathangiesbrecht's answer is more spot on. I should also mention most major registrars have free domain forwarding that's probably the easiest was to accomplish the forwarding. – Dan Hutter May 1 '13 at 1:15
Thanks Dan. It does seem like Nathan's answer is closer to what I'm looking for. Thanks for coming back in to say so, that's very helpful. – undetected May 9 '13 at 6:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.