Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have this: https://194.16.222.100/ which corresponds to www.skanetrafiken.se.

Using this, although the web browser says that there is a SSL error, I can access the web-page. However, when I remove 's' of HTTP, e.g. http://194.16.222.100/, it does not open anything and says that "Bad Request (Invalid Hostname)"

Can anyone explain me why it did not work when 's' of HTTPS is removed?

share|improve this question

migrated from serverfault.com Oct 12 '11 at 12:34

This question came from our site for professional system and network administrators.

2  
You should use your www.skanetrafiken.se name, it works correctly for both HTTPs and HTTP. –  Iain Oct 12 '11 at 12:11

3 Answers 3

The prefix is the protocol being used. HTTP is plain text, and HTTPS is HTTP over SSL. I am assuming this is not your own server, so the errors can most likely be explained as...

1) The SSL certificate is for 'www.skanetrafiken.se' and you are accessing it by the IP address instead, so the browser throws a warning because it doesn't match.

2) The domain/host might not be configured to serve it over HTTP. You would need access to the hosts configuration to determine this, but Bad Hostname makes me inclined to believe this.

Ref: HTTPS Apache vHosts

share|improve this answer
1  
I second lain's comment about hitting it by the host name. It's implied by my answer, but most public services on the Internet generally expect this. Theirs seems to as well. –  sinping Oct 12 '11 at 12:17

Http protocol uses port 80. So when you type in http://194.16.222.100/ you essentially try to connect to your server on port 80.

If you use Https, you use port 443 by default, and you browser tries to validate the certificate from your webserver.

Make sure that your server is listening on port 80, if you want to use http, but be aware that all traffic over http is unencrypted, so don't send any passwords ect.

share|improve this answer

The reason you aren't getting any web pages: Apache (I'm assuming) on the server is configured with www.skanetrafiken.se as a "Virtual Host", meaning web pages will only be served if the request comes in with that as the domain name in the URL requested. If you want the server to respond to IP address-based URLs, you need to configure Apache by editing httpd.conf or possibly another custom configuration files, e.g. something in domains-available.

Lots of help for Apache configuration is avialable at http://serverfault.com.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.