0

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>
1
  • Can you please add the non-working configuration you tried so that we have a starting point?
    – Shi
    Commented Oct 14, 2012 at 8:34

1 Answer 1

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .