Recently I decided to move the web directory found at Hpkmedia.com. Therefore I needed a domain name to put the directory on. I bought DirectorySafe.com. This took a bit of time of making sure that all the links were redirecting properly. Anytime a site is moved you want to make sure the search engines know about it!
The move itself was pretty simply I just moved the files to the new directory via FTP. I used a 301 .htaccess redirect code to make sure that all pages would be directed from the old sub domain http://dir.hpkmedia.com to http://www.directorysafe.com.
Code Used:
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.directorysafe.com/$1 [R=301,L]
This code not only redirects the main page but also all other pages associated with it.
Excellent, this code appears to also properly move every single URL, which is better than using the standard…
Redirect 301 / http://www.domain.com
Which would only forward the domain name itself. Nice work.
Posted by htaccess redirect | 13. Sep, 2008, 11:03 am