0

When I deploy my application locally or on the server, I can always access the app at either http://localhost:8080/myApp/ or http://example.com/myApp. However, whenever I add www to either of the URLs, on Chrome, I get the error Oops! Google Chrome could not find www.localhost:8080.

I'd be very grateful if you could show me how I can make my application available on both www and non-www URLs.

Best regards,

James

Mr.J4mes
  • 9,168
  • 9
  • 48
  • 90
  • of course www.localhost won't work unless you add an entry for it in hosts file. what is example.com? you added that entry in hosts file? or that is the actual domain name of the server? – damian Mar 08 '13 at 11:43

1 Answers1

0

This is probably a DNS setting. If your localhost is publishing the page, then your server is publishing the page. assumming you are accessing the page remotly (over the internet)

You will need 2 distinct DNS records to point to your page.


    host(domain)      (TYPE)  Target
    _______________   ______  __________
    www.example.com   A       [server ip]
    example.com       A       [server ip]

You could also have this accomplished using a CNAME record.

blo0p3r
  • 6,790
  • 8
  • 49
  • 68