Archive

Posts Tagged ‘htaccess’

WWW or Without WWW

January 13th, 2009 Web Hosting Indonesia No comments

To avoid duplicate content (not relevant), you must chose using www or without www. Another consideration not using www:

  • www is sub domain
  • www makes URL longer

Before decide, you must check your www pagerank anda without www pagerank.

I prefer to use without www because makes shoter url.

You can redirect all hit on subdomain www to domain on .htaccess. Just add this:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST}  ^www.(.+)$ [NC]
RewriteRule ^/(.*) http://%1/$1 [L,R=301]

If you prefer to use www instead without www, you can add this script on .htaccess:

RewriteEngine On
rewriteCond %{HTTP_HOST} ^your-domain-name-of-course.com [NC]
rewriteRule ^(.*)$ http://www.your-domain-name-of-course.com/$1 [R=301,L]

Categories: SEO Tags: , ,

How to redirect page using .htaccess

Article Source: http://www.ssi-developer.net/htaccess/redirecting.shtml

Introduction:

This guide shows you how to use .htaccess to redirect a specific page to another address. This is probably the best way to redirect pages mainly because of the lack of effort it needs to set up and it’s not browser dependent like some redirection scripts. If you have to reorganise a web site or move pages or change page extensions like I have done recently (Dec 02) then this is a life-saver!

Redirecting

Simply place the following in your .htaccess file:

Redirect /a-directory/oldpage.htm http://domain.com/b-directory/newpage.htm

The command is always the same and comprises three important parts, the word Redirect, the directory/file you want to redirect relative to the root and the full URL of the file you want to redirect to. These three ‘blocks’ must be on one line and each separated by a single space.

You can use this to redirect entire directories:

Redirect /directory http://domain.com/folder/

…or if you have simply changed file extensions:

Redirect /directory/codes.htm http://domain.com/directory/codes.shtml

Very simple but extremely useful!

Categories: SEO Tags: ,