Tuesday, September 8, 2009

How to redirect using HTML tags

Use the following HTML codes to redirect a webpage. Paste this on the top section after meta description.

<meta http-equiv="refresh" content="0;URL=http://www.google.com">

Content = 0 means the page will redirect immediately to google after the page gets loaded.

if you set this as 5 the webserver will wait 5 sec and then it will redirect the page to google.

Thursday, August 27, 2009

How to redirect using .htaccess

If you want users to be redirected to another page if they browse a specific URL, Create a .htaccess file in the root folder and add the following lines...


Redirect /book/tiger.html http://google.com/


If the user tried to access the file /book/tiger.html they will be redirected to google.com

How to protect your web directory using htaccess

First create a .htaccess file inside the directory to protect and add the following codes

AuthName "Restricted Area"
AuthType Basic
AuthUserFile /home/user/projects/.htpasswd
AuthGroupFile /dev/null
require valid-user

Create a file with the name .htpasswd in /home/user/projects/ directory and add the following lines

anish:uFWLc7lvvKExE

This is the username and password (encrypted) to access the protected directory.

To encrypt the password use the following php code:
<?php

// Password to be encrypted for a .htpasswd file
$clearTextPassword = 'admin123';

// Encrypt password
$password = crypt($clearTextPassword, base64_encode($clearTextPassword));

// Print encrypted password
echo $password;
?>

Secure and non secure URL for google analytics

Following are the secure and non secure URLs for google analytics

Non Secure:
http://www.google-analytics.com/urchin.js

Secure:
https://ssl.google-analytics.com/urchin.js

Changing and adding file extensions recognized by Dreamweaver

if your dreamweaver is not recognizing a file...or color is not applied to the code use the instructions on the following link to rectify the problem.

http://kb2.adobe.com/cps/164/tn_16410.html

Wednesday, August 26, 2009

How to switch CSS for IE browser

In case if you want to apply separate style for IE browser use the following method...

<!--[if IE]>
<style type="text/css"> .content{ background: red;}</style>
<![endif]-->