Looking for a reliable partner to bring your project to the next level? Whether it’s development, design, security, or ongoing support—I’d love to chat and see how I can help.
Secure access to single file by IP Secure access to a whole directory of files Secure a single file with a Basic Login Secure multiple files and deny access Allow only some files to be accessed Prevent directory browsing Disable hotlinking
This will request no authentication, if the Request URI has /error/ in it. SetEnvIf Apache
PHP if( !isset($_SERVER[‘PHP_AUTH_USER’]) ) { if (isset($_SERVER[‘HTTP_AUTHORIZATION’]) && (strlen($_SERVER[‘HTTP_AUTHORIZATION’]) > 0)){ list($_SERVER[‘PHP_AUTH_USER’], $_SERVER[‘PHP_AUTH_PW’]) = explode(‘:’, base64_decode(substr($_SERVER[‘HTTP_AUTHORIZATION’], 6))); if( strlen($_SERVER[‘PHP_AUTH_USER’]) == 0 || strlen($_SERVER[‘PHP_AUTH_PW’]) == 0 ) { unset($_SERVER[‘PHP_AUTH_USER’]); unset($_SERVER[‘PHP_AUTH_PW’]); } } } .htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ app.php [QSA,L] </IfModule>
If you want to prevent google to provide duplicate content from you, you can easily force www for your domains by simply using a small rewrite rule for the htaccess. RewriteEngine onRewriteCond %{HTTP_HOST} !^www.your_domain.com$RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301] CheersAlexander
portalZINE® NMN
Alexander Gräf
Stettiner Str. Nord 20
D-49624 Löningen
PORTALZINE® NMN
Alexander Gräf
Stettiner Str. Nord 20
DE-49624 Löningen