The WordPress Redirection Plugin is a great tool for redirecting urls and is especially helpful if you move your website to a different directory or change a blog location on your site. With that said, it is also a plugin with little documentation that can be hard for newcomers to navigate.
Recently we converted a client’s website from an old static html setup to be powered entirely by WordPress. The old setup had a blog that was Worpress based and all the files for the blog resided in the /blog/ folder. When we transferred the old blog to the new WordPress installation it left quite a few broken links in its path including links to images. In order to fix this we had to create a redirect that would simply remove the /blog/ folder from the url parameter however it was tricky because we did not want to forward EVERYTHING with the /blog/ string in it. Here is an example of what we wanted to rewrite:
Old file location: http://www.siteurl.com/blog/wp-content/uploads/2011/05/image.jpg New file location: http://www.siteurl.com/wp-content/uploads/2011/05/image.jpg
We wanted this to be done to ALL files with just one single redirect. So to accomplish this we put the following into the WordPress Redirection Plugin:
Be sure to check the “regex” box and replace “blog/wp-content/” and “wp-content” with your directory names.