Default server for IP Address--is it possible to prevent access via IP only?

5 posts / 0 new
Last post
#1 Sun, 06/19/2016 - 10:38
2093

Default server for IP Address--is it possible to prevent access via IP only?

Hi all,

Running a few domains over the same IP. I am aware that via "Server Configuration -> Website Options, and set "Default website for this IP" -- I choose the default domain for the IP Address.

The question is: Can I serve a 404 page, or a blank page for entrance via IP address? I don't want the IP to be accessible on its own, only via typing a domain name.

Is that possible? if so--potential downsides? (SEO or so)?

Thanks

Mon, 06/20/2016 - 06:04
wheeler

I usually create an account on the server using the FQDN for the server as the domain name (e.g. webX.myhostingcompany.com) and then use that as the default site for the IP... then have an empty directory and make sure directory listing is turned off, or an index.html page with your company logo, or a very simply server status page or something.

I don't think there are any SEO issues with this.

Mon, 06/20/2016 - 08:14
andreychek

Howdy,

Yeah, as wheeler mentioned, I'd create some sort of domain to use as the default, and have that show up whenever the system is accessed by IP address. You can set a domain as the default by going into Server Configuration -> Website Options.

-Eric

Mon, 06/20/2016 - 10:53
Diabolico
Diabolico's picture

You could try to do the same with Apache:

<VirtualHost *:80>
    ServerName 123.123.123.123
    Redirect 403 /
    ErrorDocument 403 "No"
    DocumentRoot /dev/null/
    UseCanonicalName Off
    UserDir disabled
</VirtualHost>

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Mon, 06/20/2016 - 11:03
2093

Guys thanks, what I did was to create a random named virtual server (just called it none.none for example), and enabled it as default for domain. The result now is that I get a 403 forbidden when entering by IP--which is what I wanted..

Any problem you think I should be aware of since the domain is just a random name, or is all good?

Thanks again.

Topic locked