Block access when opening IP address

Questions about hosting a Website, using MySQL and PhP may be posted here.
Forum rules
This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:
https://myds.synology.com/support/suppo ... p?lang=enu

Block access when opening IP address

Postby diskoboy » Thu Jan 19, 2012 12:01 pm

Hi,

Is it possible to block all external access when connecting to http://my.external.ip.address ?

Problem is that people just can write http://my.external.ip.address/website1 / http://my.external.ip.address/website2 ect (of cource they have to know the name)

There should be access to http://www.my-domain1.com, http://www.my-domain2.com, and so on...

Thanks
diskoboy
I'm New!
I'm New!
 
Posts: 5
Joined: Sun Jan 01, 2012 3:12 pm

Re: Block access when opening IP address

Postby axj » Thu Jan 19, 2012 12:56 pm

You can block access in many ways! I use this way for sub-pages giving redirection to the main-page!
Code: Select all
<script language="JavaScript" type="text/javascript">
  if (top == self) window.location = "http://axj.dk";
</script>
DS509+ 4*1TB Raid+1TB DSM 4.0-2219. Logitech BOOM+Duet 7.6.1, WebCam: Linksys WVC54GCA + TrendNet TV-IP121
DS212+ 1TB & D-Link DIR-685, HP C7280, Dell 3100cn. iPad3, Programming Pascal, Clarion 5.5, html/php. http://axj.dk
User avatar
axj
Specialist
Specialist
 
Posts: 1058
Joined: Fri Jan 02, 2009 10:59 am
Location: Esbjerg, Danmark

Re: Block access when opening IP address

Postby diskoboy » Thu Jan 19, 2012 7:17 pm

But disable javascript and that code doesn't work anymore... Has to be serverside.

How about .htcaccess (or what it's called...) ? Could that do the trick. Basically I want to deny ALL pages where the adress is the IP address (and ofcource not place a scipt on every single page)
diskoboy
I'm New!
I'm New!
 
Posts: 5
Joined: Sun Jan 01, 2012 3:12 pm


Return to Web Server + PHP / MySQL

Who is online

Users browsing this forum: No registered users and 0 guests