Protecting direct access to a webpage.

Xampp Apache
January 6, 2010 at 07:49:56
Specs: Windows XP
Dear sir/madam,
I have xampp latest
(php,mysql and apache for windows) running
on xp (configured as localhost).I want to
protect a page inside a
directory from directly being accessed through
index.php page is in root.
new.php is in /root/try folder (try).
I have tried .htaccess as mentioned in
websites it does not contol the direct display.

I am not able to implement session solution,
to my surprise sessions are not working (do I
have to modify something in php.ini file?).

I have although succesfully used http referer
solution but I have heard it is not reliable as
most of headers are stripped by security
software and proxies.
Please help.
Thanks in advance.

See More: Protecting direct access to a webpage.

Report •

January 6, 2010 at 09:13:09

From some reason I thought posix based os needed to be used for .httaccess.

Playing to the angels
Les Paul (1915-2009)

Report •

January 6, 2010 at 23:16:43
Hi! I was actually looking to restrict direct access to file in a
directory for eg.

index.php located at "http://localhost/webdav/c/index.php"
contains link to a file new.php located at
I was looking for a
solution which stops user from directly typing address
"http://localhost/webdav/c/try/new.php" on browser and
reaching page "new.php".(i.e new.php should be accessible
only via link in index.php.)
Your solution will force user to enter name
and password even if they follow link from index.php.

Thanks for quick reply.

Report •

January 9, 2010 at 05:48:48
solved!! please don't reply and ignore the above post.

Report •

Related Solutions

Ask Question