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.4411 |
|
0.2830 |
|
0.5941 |
|
0.3240 |
|
0.8190 |
|
0.4880 |
|
0.4818 |
|
0.6039 |
|
0.3710 |
|
0.7489 |
|
0.5419 |
|
1.0951 |
|
0.3550 |
|
0.7350 |
|
0.6719 |
|
1.2579 |
|
0.7710 |
|
0.6130 |
|
0.2999 |
|
0.2289 |
|
0.6270 |
|
2.8350 |
|
1.5109 |
|
0.4320 |
|
0.4470 |
|
1.0788 |
|
0.5472 |
|
1.2798 |
|
10.6089 |
|
0.8311 |
|
1.2732 |
|
0.9520 |
|
1.4439 |
|
8.3630 |
|
5.6322 |
|
3.5639 |
|
[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' => 'Z4taVRGSwZbjf7AIefmkbwAAcHc',
'REDIRECT_QS_ConnectionId' => '173718587715270391117763',
'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' => '117763-1504-1',
'REDIRECT_STATUS' => '200',
'UNIQUE_ID' => 'Z4taVRGSwZbjf7AIefmkbwAAcHc',
'QS_ConnectionId' => '173718587715270391117763',
'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' => '117763-1504-1',
'SERVER_SIGNATURE' => '',
'SERVER_NAME' => 'www.zzzzzzzzz.net',
'SERVER_ADDR' => '192.185.137.117',
'SERVER_PORT' => '443',
'REMOTE_ADDR' => '52.15.190.187',
'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' => '61964',
'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' => 1737185877.1612799167633056640625,
'REQUEST_TIME' => 1737185877,
'argv' =>
array (
),
'argc' => 0,
);