M Sach
M Sach

Reputation: 34424

Accessing the webapplication with domain instead of localhost/ipaddress gives WebPage not found?

i have my java webapplication deployed on tomcat. I am able to access it with

https://localhost:8443/myWebAp

But i want access it with some domain name instead of localhost. For this i make an below entry in hosts file at C:/Windows/System32/drivers/etc/hosts

       10.215.134.45   shopCart.myApp.com

Now i access my application with url

       https://shopCart.myApp.com:8443/myWebAp

it says webpage can not be found. Though as soon as i enter my ip i.e 10.215.134.45 instead of shopCart.myApp.com it works fine. Another weird thing is if i give entry as

  10.215.134.45   shopCart 

and now acceess the app with

 https://shopCart:8443/myWebAp 

it works fine but as soon as i append some .(dot) with shopCart, looks like it browser is not able to resolve ip against shopCart.myApp.com. I am not getting whats the reason behind it?I also tried giving 127.0.0.1 instead of my ip against domain name but same result

Upvotes: 3

Views: 1312

Answers (1)

Rajesh J Advani
Rajesh J Advani

Reputation: 5710

This generally happens only if you are behind a proxy, and the browser is using your proxy to resolve the URL rather than using your hosts file/DNS. You should add *.myApp.com to the proxy exceptions list, to ensure that it resolves the IP address for the domain using your hosts file.

Upvotes: 3

Related Questions