Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm trying to set up the AJAX Push Engine, and I've run into some complications using apache. All I want to do, is whenever I go to some address (e.g. *.example.com), forward it to some other address (e.g. mysite.com).

My httpd-vhosts.conf looks like this...

NameVirtualhost *.example.com

<VirtualHost *.example.com>
    ServerName example.com
    ProxyPass / http://mysite.com/
</VirtualHost>

But if I ping 0.example.com, it doesn't give me the IP address of mysite.com.

What is it that I am missing? If there is an easier way to do this without apache, I'm all ears: I had previously tried to just edit the hosts file, but apparently host files can't contain wildcards.

Thanks!

share|improve this question

migrated from superuser.com Jun 30 '11 at 17:33

This question came from our site for computer enthusiasts and power users.

1 Answer 1

up vote 0 down vote accepted

if I ping 0.example.com, it doesn't give me the IP address of mysite.com.

The IP address you get for 0.example.com is returned by a DNS server. If you can edit the DNS record for example.com, then you can get that domain name to resolve to the IP of your choice.

If you just need to do some local testing, then you can edit your hosts file, so your machine will resolve any hostname to any IP you like, but doing that only affects your own machine.

share|improve this answer

Your Answer

 
discard

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.