Skip to content

Instantly share code, notes, and snippets.

@arkadiusjonczek
Last active September 21, 2024 18:02
Show Gist options
  • Select an option

  • Save arkadiusjonczek/61d6713779412a2257e21d356ee7ebda to your computer and use it in GitHub Desktop.

Select an option

Save arkadiusjonczek/61d6713779412a2257e21d356ee7ebda to your computer and use it in GitHub Desktop.
.htpasswd path finder for .htaccess file
AuthType Basic
AuthName "wiki"
AuthUserFile /path/.htpasswd
Require valid-user
# check http://www.htaccesstools.com/htpasswd-generator/
<?php
$dir = dirname(__FILE__);
echo "<p>Full path to this dir: " . $dir . "</p>";
echo "<p>Full path to a .htpasswd file in this dir: " . $dir . "/.htpasswd" . "</p>";
echo $_SERVER['DOCUMENT_ROOT'];
?>
@arkadiusjonczek
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment