Tuesday, June 14, 2011

Redirecting Old Site Pages to New WordPress Site

Do you know how many sites link to your old sites' pages? Is your site referenced in Wikipedia? Do you want to keep your old site's search rankings? Then you'll probably want to do a 301 (permanent) Redirect. You do this by creating or editing your site's .htaccess file.

Your WordPress site probably already has a .htaccess file. I copied mine to my local machine and underneath this:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

I followed this guide and added this below:
redirect 301 /chapters.htm http://www.pnwpga.com/chapters

... etc. until I'd included all the important pages from the old site and their new equivalents (one on each line).

I uploaded the new .htaccess file and saved it over the existing one in my site's root folder. All the redirects are working perfectly! Now I don't have to worry about breaking links on external sites or losing pnwpga.com's good search rankings.


No comments:

Post a Comment