Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Prevent URL from switching from domain name to IP

    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.

  • #2
    New Coder
    Join Date
    Jun 2009
    Posts
    14
    Thanks
    0
    Thanked 1 Time in 1 Post
    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/

  • #3
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    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.
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog

  • #4
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Quote Originally Posted by ComputerX View Post
    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.

  • #5
    Super Moderator
    Join Date
    Feb 2009
    Location
    England
    Posts
    539
    Thanks
    8
    Thanked 63 Times in 54 Posts
    Quote Originally Posted by MattF View Post
    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.
    lamped.co.uk :: Design, Development & Hosting
    marcgray.co.uk :: Technical blog

  • #6
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Quote Originally Posted by ComputerX View Post
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •