Skip to content

Instantly share code, notes, and snippets.

@shazow
Created November 22, 2010 05:40
Show Gist options
  • Save shazow/709572 to your computer and use it in GitHub Desktop.
Save shazow/709572 to your computer and use it in GitHub Desktop.
Redirecting Wordpress blog post links to Posterous blog post links
# Redirect shazow.net/blog -> blog.shazow.net
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
# Keep serving static files
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Redirect the blog post slugs to Posterous equivalents (truncated to 45 chars)
RewriteRule ^[0-9]{4}/[0-9]{2}/[0-9]{2}/(.{1,45}).*$ http://blog.shazow.net/$1 [R=301,NE]
# Redirect the RSS feeds
RewriteRule ^feed.*$ http://feeds.feedburner.com/shazow?format=xml [R=301]
# Redirect the rest of the blog
RewriteRule .* http://blog.shazow.net/ [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment