I need to create a secure directory in Apache2.
I have a directory /var/www
with my login page and /var/www/secure/
with all the rest of my PHP, JavaScript and HTML.
I send a login request, and after a successful response, I want to run the rest of my site from /var/www/secure/
, so I make a call to /var/www/secure/index.php
from /var/www/login.php
.
All the paths in /var/www/secure/index.php
are relative (to /var/www/secure/
), but then I get an error (in the Apache log):
File does not exist: /var/www/scripts, referer: my_IP_Address/login.php
Where the script's directory located at /var/www/secure/scripts
is the same as /var/www/secure/index.php
.
My question is: Why does the path remain /var/www/
just as the login.php file?
How can I take care of the path once I call /var/www/secure/index.php
?