Tuesday, January 5, 2010

301 non-www to www or Permanent Redirect any single file URL to give some other one

Permanent Redirect your URL from non-www to www by using following code

RewriteEngine On
RewriteCond %{HTTP_HOST} ^websitedesigning-company.com [NC]
RewriteRule ^(.*)$ http://websitedesigning-company.com/$1 [L,R=301]

or

Permanent Redirect any single file URL to give some other one

RewriteCond %{HTTP_HOST} ^websitedesigning-company.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.websitedesigning-company.com$
RewriteRule ^mtp\/career_profile\.php$ "http\:\/\/websitedesigning\-company\.com\/mtp\/career\-advice\-online" [R=301,L]

OR
RewriteRule oldfile name$ new file name with full path
RewriteRule ^career-advice/interview-coaching$ http://www.mytalentplace.co.uk/interview-skills/interview-coaching [R=301,L]


for every . and /
we have to use \. or \/

No comments:

Post a Comment