Jump to content

Restrict phpVMS Access by IP Address


StartVM

Recommended Posts

I have noticed quite a few virtual airlines that struggle to secure their website during development and beta testing. As you all know, without the correct protections, it is easy to view the website by appending /index.php to the URL. In order to combat this and restrict access to your entire phpVMS website by IP address, simply replace your index.php file in your root phpVMS directory with this attachment. The original code has been unaltered, I added about 16 lines of code to the top of it for the ip handling. The code is commented and quite self explanatory on how to work it. Cheers!

index.php

Link to comment
Share on other sites

Or, if you'd prefer not to edit core files, a couple of lines in your .htaccess, which also protects other parts of your site:

Order deny,allow
Deny from all
Allow from ##.##.##.##

Depending on how the web server is configured, it can get complicated if you want to allow a coming soon template to display in the root directory, but good tip

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...