RSS

301 Redirect Examples

Mon, Aug 25, 2008

SEO services

To Move a single page

Redirect 301 /oldpage.html http://www.example.com/newpage.html

To Move an entire site

Redirect 301 / http://www.example.com/

Change file extension

RedirectMatch 301 (.*)\.html$ http://www.example.com$1.php

Redirect www to non www version of site

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^example\.com
RewriteRule (.*) http://example.com/$1 [R=301,L]

Redirect non-www to www

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^yoursite.com [NC]
RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301]

Redirect example.com/index.php to example.com/

Options +FollowSymLinks
RewriteEngine on
# index.php to /
RewriteCond %{THE_REQUEST} ^[A-Z]{3, 9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

,

This post was written by:

admin - who has written 112 posts on Web 2.0 Design Articles and Tutorials.


Contact the author

Leave a Reply

CAPTCHA image