Through acts of vanity I spose, I’ve decided to change my URL again. I was using ns1.net for quite some time for my personal webspace and domain. Now I’ve decided to dust off one of my domains. It might seem familiar. ;p
Outside of copying config files, and renaming one thing to another, it’s pretty much a simple .htaccess rule addition to make the internet robots happy.
RewriteCond %{HTTP_HOST} px\.ns1\.net$ RewriteRule ^(.*)$ http://blog.playerx.net/$1 [R=301,L]
awstats renaming of datafiles.
awstats $ sudo rename px.ns1.net playerx.net *
Here is some SQL magic to fix-up the mySQL wp_posts table.
# mysql code to change the previous URL in all posts UPDATE wp_options SET option_value = replace(option_value, 'http://oldurl.tld, 'http://blog.playerx.net') WHERE option_name = 'home' OR option_name = 'siteurl'; # replace GUID UPDATE wp_posts SET guid = replace(guid, 'http://oldurl.tld','http://blog.playerx.net'); # update all the posts with static old static URL UPDATE wp_posts SET post_content = replace(post_content, 'http://oldurl.tld', 'http://blog.playerx.net'); # that will only update posts with full URL "http://oldurl.tld" # I still need to figure out what to do with the amazon files # ex. http://files.blog.playerx.net/wp-content/uploads/2010/04/Screen-shot-2010-04-06-at-4.10.17-PM.png # UPDATE wp_posts SET post_content = replace(post_content, 'http://files.oldurl.tld', 'http://files.blog.playerx.net');
I also had to download all the contents of the Amazon S3 bucket, since moving, renaming, or copying buckets is not yet supported per the S3 documentation.
