
Many people may not know that Beyond the Rhetoric was originally hosted by GoDaddy and made use of their free QuickBlog software. It was very restrictive and that’s why I eventually moved the blog to WordPress. Unfortunately for me, the default permalink structure with QuickBlog came with an .aspx extension for every post.
I wanted to keep any backlinks that I had, so I continued with the same permalink structure in WordPress until just recently. I’ve been meaning to ditch the .aspx extension for some time, but I never really knew how. After all, none of my posts are actually in aspx. I didn’t want to lose backlinks, so I had to figure out a way to set up a permanent 301 redirect for all the posts. For that, I asked Matt for some help and he came through with flying colors.
As Matt described it, the code below is designed “so /2007/11/19/post-title.aspx permanently [301] redirects to /2007/11/19/post-title/”. The first part is to go into WordPress and adjust the information in options/permalinks to the date/post-title structure. The second part is to insert this code into your .htaccess file, somewhere above the “# BEGIN WordPress” line.
# START Redirection of .aspx Extension
RewriteEngine On
RewriteBase /
RewriteRule ^/?([-a-zA-Z0-9/]+)\.aspx$ $1/ [R=301,L]
# END Redirection of .aspx Extension
I’ve implemented Matt’s code and it works like a charm. I’d imagine that the code would be nearly identical if you wanted to go from a /post-title.php permalink structure to a /post-title/ structure.





ninja.s
November 30, 2007 12:23 pm
Great idea. Congrats on making the move. It’s hard to find someone who can help you out for free, count yourself lucky.