Page 1 of 1
Prevent URL from switching from domain name to IP
Posted: Sat Feb 06, 2010 1:52 pm
by amh1010
My site is hosted on my own machine, but I have a domain name directed at my IP. When a user enters my domain, and goes to my site, the URL switches to my IP and stays. How do I prevent this? Is there some PHP code that would help the problem? Thanks for any help.
EDIT: I'm using GoDaddy and WAMP.
Re: Prevent URL from switching from domain name to IP
Posted: Sat Feb 06, 2010 5:08 pm
by Christopher
What webserver are you using? Apache? My guess is that you do not have the domain name configured so the name of your site is the IP address.
Re: Prevent URL from switching from domain name to IP
Posted: Sat Feb 06, 2010 5:50 pm
by amh1010
Yeah, it's Apache. I've looked for how to make it work on Apache, but to no avail. If you could help, or at least point me in the right direction, that'd be great. I'm running out keywords to search in Google, haha
Re: Prevent URL from switching from domain name to IP
Posted: Sat Feb 06, 2010 6:04 pm
by Christopher
Re: Prevent URL from switching from domain name to IP
Posted: Sat Feb 06, 2010 6:55 pm
by amh1010
If you mean in my httpd.conf file, it says:
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName http://www.realtorboss.com:80
#
# DocumentRoot: The directory out of which you will serve your
Re: Prevent URL from switching from domain name to IP
Posted: Sat Feb 06, 2010 7:46 pm
by Christopher
However your frame is:
Code: Select all
<frameset rows="100%,*" border="0">
<frame src="http://xxx.xxx.xxx.xxx" frameborder="0" />
<frame frameborder="0" noresize />
</frameset>
And since your links are relative they will take that. You might want to set your server as as subdomain like "ww2.realtorboss.com" or on a different port.
Re: Prevent URL from switching from domain name to IP
Posted: Sun Feb 07, 2010 10:46 pm
by amh1010
If I use frames, won't that still give me a static URL?