Aliante Search Engine Optimization | Internet Marketing Blog | SEO Web Design

phone - call us

Whole Website Redirect
RewriteEngine ON
RewriteRule ^(.*)$ http://newwebsite.com/$1 [R=301,L]

WWW Redirect
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

One Page Redirect
redirect 301 /old-file-name.html http://www.domainname.com/new-file-name.html

301 Redirect Statements

  • [NC]: The statement [NC] can be used within a 301 redirect rewrite rule. It simply tells your server that the value before it is not case sensitive, and ignores differences between capitalized and non-capitalized letters.
  • [L]: This statement, when used at the end of a rewrite rule, tells the server that it is the “last line” in the set. Anything that comes afterward will not be processed in that set. For instance, “RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]”
  • Options +FollowSymLinks: You might see this in your existing htaccess file, before “RewriteEngine on”. It’s a statement that enables your “Mod Rewrite” function.
 

Comments are closed.