Running: Redhat 7.2 and Apache 1.3.20
I am typing the domain name in my browser but when it serves up the page the URL changes to the server IP.
Example: I type http://www.test.com and when the page loads the URL changes to http://66.66.66.66
I have my NameVirtualHost setup per the docs. Why is this happening to me?
Help
elsmore1
03-19-2002, 11:00 PM
If you don't give a fully qualified URL (you leave off the trailing slash) the server "negotiates" the URL to a fully qualified one based on the "Server Name" directive. If you put the trailing slash on http://www.test.com/ that is where you will go. If you change the Server Name directive, youwill wind up at the new Server Name instead of the IP (which is what the server name is set to now).
Originally posted by urk5
Running: Redhat 7.2 and Apache 1.3.20
I am typing the domain name in my browser but when it serves up the page the URL changes to the server IP.
Example: I type http://www.test.com and when the page loads the URL changes to http://66.66.66.66
I have my NameVirtualHost setup per the docs. Why is this happening to me?
Help
bombino
03-19-2002, 11:13 PM
In your httpd.conf, you need to set the ServerName to www.yourname.com.
<VirtualHost ip.ip.ip.ip>
ServerName www.yourname.com
</VirtualHost>
Here's an example of what I have:
NameVirtualHost xx.xx.xx.xx
<VirtualHost xx.xx.xx.xx>
DocumentRoot /var/www/html/site4
ServerName www.xx.net
</VirtualHost>
Yet the IP comes up instead of the ServerName. I have the site in DNS. I added an entry in my /etc/hosts file just in case.
Still no luck. arghh!!
Thanks for the help so far.
elsmore1
03-19-2002, 11:33 PM
Did you just now change the ServerName or was it like that before?
If you just now changed it, did you restart apache afterwards?
Is this a secret site or something? It is often easier to give good advice if we actually know the site name in question.
Originally posted by urk5
Here's an example of what I have:
NameVirtualHost xx.xx.xx.xx
<VirtualHost xx.xx.xx.xx>
DocumentRoot /var/www/html/site4
ServerName www.xx.net
</VirtualHost>
Yet the IP comes up instead of the ServerName. I have the site in DNS. I added an entry in my /etc/hosts file just in case.
Still no luck. arghh!!
Thanks for the help so far.
The ServerName has always been set properly. I have been restarting apache after each change and change-back.
Here's the actual code:
NameVirtualHost 64.239.184.18
<VirtualHost 64.239.184.18>
DocumentRoot /var/www/html/site1
ServerName www.sweet-r.net
</VirtualHost>
Be warned this is an adult site. I wasn't sure if it's okay to post it on the board. If it isn't please remove.
Type the URL you'll see what I mean.
elsmore1
03-20-2002, 12:11 AM
you have a redirect at that URL which points to the IP address.
<meta http-equiv="refresh"
content="0;url=http://xx.xx.xx.xx/">
I never would have figured that out without the URL. You can delete it now if you want. :)
thanks for the help... I got my butt kicked on this one.
DNS had not propagated yet. I received the confirmation for netsol yesterday and I assumed the propagation would of took place by now. I spent the whole time looking at the new site and not the old one. Once again I learn to never assume :-)
Thanks again.