Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I was wondering how to make a simple redirection, I've got WAMP installed on my computer and I wish I could do that: When I go to abc.com it redirects to xyz.com. I did this in the httpd.conf file, but it isn't working.

It seems to work now, but only when I go to localhost. However, what I want is that when I go to abc.com it goes to xyz.com, and I can't do that.

Here is my conf :

   <VirtualHost *:80 >

    ServerName abc.com
    Redirect permanent / http://www.xyz.com/

    </VirtualHost>
share|improve this question
    
Can you please add the non-working configuration you tried so that we have a starting point? –  Shi Oct 14 '12 at 8:34
    
Yes, thank you, done. –  Meds Oct 14 '12 at 8:47

1 Answer 1

I do not know your intention, but you can make your configuration work by claiming that your computer actually is abc.com.

For this to do you need to edit your hosts file and add the following line:

abc.com 127.0.0.1

Right now in your configuration, your webbrowser asks a DNS server for the IP of abc.com and the DNS server replies with an external IP address. Due to this, your local server never sees the request so it never acts on it.

If you want this to work across your network you should consider using a HTTP proxy rather than a webserver.

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.