Excellent Apache mod_rewrite Cheat Sheet
REQUEST_URI
Excellent Apache mod_rewrite Cheat Sheet
REQUEST_URI
Simple Password Protection for a Directory Using .htaccess
The basic snippets are:
The basic .htaccess configuration tells this directory to use basic authentication, what to title the login dialog and where to find the .htpasswd file.
AuthType Basic AuthName "restricted area" AuthUserFile /home/user_name/public_html/protected-dir/.htpasswd require valid-user
.htpasswd is simple a list of usernames and passwords in the format of: user_name:password. One entry per line.
your_user_name:secret_password another_user:another_password someone_else:I*3joidsl__2
Resource: David Wals Blog
1) Put your .htpasswd above your root so visitors can’t access it #/html/username/.htpasswd put username and encryped password of your members 2) It doesn’t matter how many files under how many directories you wanted to protect as they can share … Continue reading
No entries found. |
No entries found. |
0.6280 |
|
0.4761 |
|
0.5171 |
|
0.8080 |
|
9.3060 |
|
0.2708 |
|
0.1628 |
|
0.4570 |
|
0.2542 |
|
0.5100 |
|
0.2310 |
|
0.7179 |
|
0.0911 |
|
0.2859 |
|
0.3810 |
|
1.0660 |
|
0.4489 |
|
0.3829 |
|
0.1700 |
|
0.1550 |
|
0.3719 |
|
1.2219 |
|
0.8671 |
|
0.6340 |
|
0.7710 |
|
0.9570 |
|
0.4101 |
|
1.0891 |
|
8.8749 |
|
0.8080 |
|
1.3790 |
|
1.0390 |
|
0.7901 |
|
3.1600 |
|
0.9620 |
|
0.6299 |
|
[0] => themes/twentyeleven/inc/theme-options.php [1] => themes/twentyeleven/inc/widgets.php [2] => themes/twentyeleven/tag.php [3] => themes/twentyeleven/header.php [4] => themes/twentyeleven/searchform.php [5] => themes/twentyeleven/content-link.php [6] => themes/twentyeleven/content.php [7] => themes/twentyeleven/sidebar.php [8] => themes/twentyeleven/footer.php [9] => themes/twentyeleven/sidebar-footer.php
$_GET = array (
);
$_POST = array (
);
$_COOKIE = array (
);
$_SESSION = array (
);
$_SERVER = array (
'SERVER_SOFTWARE' => 'Apache',
'REQUEST_URI' => '/tag/htaccess/',
'LSPHP_ENABLE_USER_INI' => 'on',
'PATH' => '/usr/local/bin:/usr/bin:/bin',
'TEMP' => '/tmp',
'TMP' => '/tmp',
'TMPDIR' => '/tmp',
'PWD' => '/',
'HTTP_ACCEPT' => '*/*',
'HTTP_ACCEPT_ENCODING' => 'gzip, br, zstd, deflate',
'CONTENT_LENGTH' => '0',
'HTTP_HOST' => 'www.zzzzzzzzz.net',
'HTTP_REFERER' => 'https://zzzzzzzzz.net/tag/htaccess',
'HTTP_USER_AGENT' => 'Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)',
'HTTP_X_HTTPS' => '1',
'REDIRECT_UNIQUE_ID' => 'Z7qJxTrzNU17O5QSXRcrDQABGxM',
'REDIRECT_QS_ConnectionId' => '174027821389473867839411',
'REDIRECT_SCRIPT_URL' => '/tag/htaccess/',
'REDIRECT_SCRIPT_URI' => 'https://www.zzzzzzzzz.net/tag/htaccess/',
'REDIRECT_HTTPS' => 'on',
'REDIRECT_SSL_TLS_SNI' => 'www.zzzzzzzzz.net',
'REDIRECT_HTTP2' => 'on',
'REDIRECT_H2PUSH' => 'off',
'REDIRECT_H2_PUSH' => 'off',
'REDIRECT_H2_PUSHED' => '',
'REDIRECT_H2_PUSHED_ON' => '',
'REDIRECT_H2_STREAM_ID' => '1',
'REDIRECT_H2_STREAM_TAG' => '839411-1782-1',
'REDIRECT_STATUS' => '200',
'UNIQUE_ID' => 'Z7qJxTrzNU17O5QSXRcrDQABGxM',
'QS_ConnectionId' => '174027821389473867839411',
'SCRIPT_URL' => '/tag/htaccess/',
'SCRIPT_URI' => 'https://www.zzzzzzzzz.net/tag/htaccess/',
'HTTPS' => 'on',
'SSL_TLS_SNI' => 'www.zzzzzzzzz.net',
'HTTP2' => 'on',
'H2PUSH' => 'off',
'H2_PUSH' => 'off',
'H2_PUSHED' => '',
'H2_PUSHED_ON' => '',
'H2_STREAM_ID' => '1',
'H2_STREAM_TAG' => '839411-1782-1',
'SERVER_SIGNATURE' => '',
'SERVER_NAME' => 'www.zzzzzzzzz.net',
'SERVER_ADDR' => '192.185.137.117',
'SERVER_PORT' => '443',
'REMOTE_ADDR' => '3.145.86.133',
'DOCUMENT_ROOT' => '/home1/zzz/public_html',
'REQUEST_SCHEME' => 'https',
'CONTEXT_PREFIX' => '',
'CONTEXT_DOCUMENT_ROOT' => '/home1/zzz/public_html',
'SERVER_ADMIN' => 'webmaster@zzzzzzzzz.net',
'SCRIPT_FILENAME' => '/home1/zzz/public_html/index.php',
'REMOTE_PORT' => '54970',
'REDIRECT_URL' => '/tag/htaccess/',
'SERVER_PROTOCOL' => 'HTTP/2.0',
'REQUEST_METHOD' => 'GET',
'QUERY_STRING' => '',
'SCRIPT_NAME' => '/index.php',
'PHP_SELF' => '/index.php',
'REQUEST_TIME_FLOAT' => 1740278213.9016239643096923828125,
'REQUEST_TIME' => 1740278213,
'argv' =>
array (
),
'argc' => 0,
);