I need to find the absolute path of my site in the same way that php outputs it if I run the file directly with the following code in the root of my site:
<?php
echo realpath(dirname(__FILE__));
?>
Problem is, I have .htpasswd
implemented for security reasons, but I have the wrong full path in there and need to get to find out the full path by other means...
So, if there is a .htaccess way of maybe putting in the full path of my site into the URL Address, or outputting it directly within the .htaccess login box, that would be great... so that I can fix this in the .htpasswd file.
Any ideas? I don't want to remove the password login for even a second as it is needed for huge security implications. How can I do this by another means?
Here is the contents of my .htpasswd file:
htpasswd -c /home/before_publichtmldir/.htpasswd user
New password: PASSWORD
Re-type new password: PASSWORD
Adding password for username user
So, my username = user and password = PASSWORD
But typing this in keeps popping up the dialog and never accepts it as the correct username and password.
# Require popup dialog for access
AuthType Basic
AuthName "You must give a password"
AuthUserFile /home/before_publichtmldir/.htpasswd
Require valid-user
But no matter what I put in here it continuously loops the Dialog asking for my username and password again. So, my conclusion is that the path must be wrong here.
Also, does .htaccess and .htpasswd have to be within the same directory for this to work?