...

View Full Version : Prevent URL from switching from domain name to IP



amh1010
02-06-2010, 08:08 PM
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.

Jeremy Ross
02-06-2010, 08:37 PM
What your looking for is DNS hosting - I am not sure if your domain name register provides this - if not you can look at this website: http://www.dyndns.com/

Lamped
02-07-2010, 09:30 AM
Sounds like you either have some weird web forwarding or a redirect in your local code. Assuming it's the web forwarding, you need to change your domain settings to have the "www." A record set to your IP address. If your domain registrar won't let you do this, you can change your nameservers to something like zoneedit.com and edit the www A record there.

MattF
02-07-2010, 05:56 PM
Sounds like you either have some weird web forwarding or a redirect in your local code. Assuming it's the web forwarding, you need to change your domain settings to have the "www." A record set to your IP address. If your domain registrar won't let you do this, you can change your nameservers to something like zoneedit.com and edit the www A record there.

The www. part is irrelevant. That's an unnecessary prefix. A standard A record is all that is needed. Prefix or anything else is moot as long as the record points to a valid I.P address.

The webserver software being misconfigured is the most likely culprit if the I.P to name mapping isn't working correctly.

Lamped
02-07-2010, 06:40 PM
The www. part is irrelevant. That's an unnecessary prefix. A standard A record is all that is needed. Prefix or anything else is moot as long as the record points to a valid I.P address.

The webserver software being misconfigured is the most likely culprit if the I.P to name mapping isn't working correctly.

His wording and the fact it's in this sub-forum would strongly suggest it's for a website. The www prefix is by far the most common domain prefix for websites, incase you weren't aware. This would lead me to assume his domain is www.domain.tld -> IP. However, that is not worth nit-picking over, is it?

He suggests, though I could have mis-interpreted, that it's changing from doman.tld -> x.x.x.x notation in his address bar. This is less likely to be server misconfiguration as the server would have to specifically generate a 302, Refresh header, or somesuch.

MattF
02-08-2010, 12:53 AM
The www prefix is by far the most common domain prefix for websites, incase you weren't aware.


Arse is a more widely used term than bottom, but more commonly known or used does not necessarily mean correct. Again, www. is moot and pointless to any discussion. It means absolutley zero. People should be encouraged not to use it rather than the opposite. At least something like the ftp. prefix has a purpose and lets the browser know that you are not intending to connect to the standard http port. www. has no such use.

Wiht regards to the I.P issue, I'll still hedge my bets on it being a server misconfiguration, personally. It's not a competition, btw. It doesn't matter a toss which of us is correct. (I know I won't lose a wink of sleep if I'm incorrect). The O.P now has enough suggestions to trace the problem, which is all that matters.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum