I was wondering if it is possible to write a comment on the .htpasswd
file.
Why ? Because sometimes, we have to "disable" some users, just for a couple of days. I checked on StackOverflow and other websites, and it seems pretty confusing :
::
#
(like .htaccess)::bar:$apr1$G3iw8iqc$IGNoXDw7e7HolcSgE/V0a0
#foo:$apr1$3dJLDmbn$/zODUbSXmqDfeeCmMFKO8/
NB: I don't want to disable users by adding a fake char at the beginning of the line, for instance. I want a clean way, if this is possible ;)
After testing, both seems to work, but I want some expert opinions (and btw VIm doesn't syntax highlight neither ::
nor #
)
htaccess file is done by adding a # at the beginning of the line(s) that you would like to comment. The # is required before each line of comment. Essential this instructs the server to ignore that line in the . htaccess file.
php echo dirname(__FILE__) . '/. htpasswd'; ?> Then access it via your browser and it should display the full path you'll need to put in your .
Apache's config file format (of which .htaccess
files are one example) doesn't technically support inline comments, only full-line comments (i.e. a line beginning with a #
).
Lines that begin with the hash character "#" are considered comments, and are ignored. Comments may not be included on a line after a configuration directive. -- Official Apache 2.4 manual
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With