Archive for the ‘cgi’ Category

Convert Your http to https

Friday, June 6th, 2008

 Create a .htaccess file and copy the code from below as it is , and upload the folder you want to convirt http to https .

Be if you have .htaccess file in that perticuler folder . If yes donwload the file and add the below code

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

.htaccess redirect url

Thursday, March 13th, 2008

You can rediret your url .
edit your .htaccess file and replace the file names
Redirect oldfile.html newdomain/newfile.html

.htaccess allow single file

Thursday, March 13th, 2008

You can allow single file unprotected and rest of others can be protected
just about to replace your file name and password file

<FilesMatch [^sample.php]>
AuthUserFile /fulladdress of your password file/filename
AuthGroupFile /dev/null
AuthName ‘Members Only’
AuthType Basic
require valid-user

</FilesMatch>

.htaccess protect single file to perticuler folder

Thursday, March 13th, 2008

In order to protect a file, just replace Directory directive with Files:

<Files sample.cgi>
AuthType Basic
AuthName "Protected Access"
AuthUserFile /usr/local/apache/passwd
Require valid-user </Files>

How do I protect a directory with .htaccess?

Thursday, March 13th, 2008

If you have a folder on your website that contains sensitive or restricted information, you can password-protect it to prevent unauthorized visitors from seeing its contents using what’s called “HTTP authentication” . There are two ways to password protect folders/directories on your website.

 The .htaccess file should contain the following 4 lines:
AuthType Basic
AuthName “Some Description”
AuthUserFile /[home dir full path]/[passwordfile]
Require valid-user

what is .htaccess ?

Thursday, March 13th, 2008

.htaccess files (or “distributed configuration files”) provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.