Wednesday, January 12, 2011

Redirecting non www URL to www URL

If you type yahoo.com in browser it will be redirected to www.yahoo.com.
If you want to do same with your website then put the following code to .htaccess file.

CODE:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^optimaxwebsolutions\.com$
RewriteRule (.*) http://www.optimaxwebsolutions.com/$1 [R=301,L]

Where $1 is the first argument kind of thing like for example if you want to redirect

http://drupal.com/user => http://www.drupal.com/user .

No comments:

Post a Comment

Customizing the Search form - Drupal

To change the label text and text inside the search box and the text on the submit and changing the Submit button image, you can use the fo...