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.4721 |
|
0.6521 |
|
0.4799 |
|
0.4771 |
|
0.5620 |
|
0.4120 |
|
0.5848 |
|
0.7310 |
|
0.5929 |
|
0.8490 |
|
0.7060 |
|
1.0130 |
|
0.4151 |
|
0.6230 |
|
3.5620 |
|
1.2310 |
|
0.8099 |
|
0.7210 |
|
0.6309 |
|
0.6831 |
|
0.6239 |
|
1.5810 |
|
0.9189 |
|
0.7970 |
|
1.8029 |
|
0.9320 |
|
0.4590 |
|
0.5128 |
|
7.3750 |
|
0.7930 |
|
1.0800 |
|
0.8638 |
|
0.4251 |
|
3.0849 |
|
0.8910 |
|
0.5951 |
|
[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' => 'aAyYMAJQbcuQrWBRoy-BhQABLgk',
'REDIRECT_QS_ConnectionId' => '174565585671545021119127',
'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' => '7',
'REDIRECT_H2_STREAM_TAG' => '119127-106-7',
'REDIRECT_STATUS' => '200',
'UNIQUE_ID' => 'aAyYMAJQbcuQrWBRoy-BhQABLgk',
'QS_ConnectionId' => '174565585671545021119127',
'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' => '7',
'H2_STREAM_TAG' => '119127-106-7',
'SERVER_SIGNATURE' => '',
'SERVER_NAME' => 'www.zzzzzzzzz.net',
'SERVER_ADDR' => '192.185.137.117',
'SERVER_PORT' => '443',
'REMOTE_ADDR' => '13.58.37.107',
'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' => '30882',
'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' => 1745655856.7245891094207763671875,
'REQUEST_TIME' => 1745655856,
'argv' =>
array (
),
'argc' => 0,
);