Web Development

General discussion


Alternatives to .htaccess?

By Murmuration ·
I'm aware of the procedures for .htaccess but I'm
wondering ehat the options are in the following
I'm trying to restrict access to a folder in a domain to just
the folk inside one institution, and my home IP address. (
Trying to 'roll my own as the institution facilities don't really
meet my needs) I could use a password but the nature of
the users means this is adding an unwanted complexity.
As the address is in the form 10.xxx.xxx.200 what are the
options? Just a password and hope the machines always
have cookies enabled? If so what is the best? A PHP script
relating to a folder? Any newdie - level ideas appreciated!

This conversation is currently closed to new comments.

Thread display: Collapse - | Expand +

All Comments

Collapse -

yes ..alternative exist

by soring9 In reply to Alternatives to .htaccess ...

use PHP sessions
is secure and easy to keep your goals with PHP sessions.

make an index.php for this folder where you check
if session is registered (user is logged) > if not, redirect unwanted search to error.php ( where you keep a message for this.. )

PHP have a lot of function for work with sessions
so you can make a vesatile app.

Jus try .. and compare with .htacces method

Note: .htacces dont work under windows servers
PHP session will work well.

Collapse -

HTTP Headers

When your users request pages, within their HTTP request is the IP from which they're requesting. You can retrieve these headers using PHP, ASP, PERL, .NET or whatever. (I haven't seen ANY language that won't let you read the HTTP headers.

One note, though. If security is really, really threatened - IP spoofing may become a problem. For example - government sites, SCO and Microsoft contracts are prime targets for IP spoofing.

Related Discussions

Related Forums