Oct
30
2009
Uncategorized

301 Redirect for Apache

Write to file called ‘.htaccess’. The file is named only as an extension.Hidden files must be viewable in operating system. mod_rewrite must be enabled
Command Description
Redirect 301 /oldpage.html http://www.ournewdomain.com/newpage.html Redirect single file or directory to a newfile or directory on a different domain
RewriteEngine onRewriteCond %{HTTP_HOST} ^mysite\.com [NC]RewriteRule (.*) http://www.oursite.com/$1 [L,R=301] Redirect http://oursite.com to http://www.oursite.com. Affects entire domain
Entire site:Redirect 301 / http://www.ournewdomain.com/Redirect permanent /old http://www.ournewdomain.com/new Redirect entire domain to a new domainas either a 301 (recommended

About the Author:

Leave a comment

 

October 2009
M T W T F S S
    Jul »
 1234
567891011
12131415161718
19202122232425
262728293031  
  Domain Name + 1GB Linux India Web Hosting in Rs.349