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:

Redirection Plugin

 

Be sure to check the “regex” box and replace “blog/wp-content/” and “wp-content” with your directory names.

This Post Has 3 Comments

  1. edi

    dear sir… is this for one cpanel only? how if i want to redirect to other url such as facebook album or other service. maybe you have any good idea? thanx

    1. Chris Moore

      edi,
      This is for redirecting within a plugin within WordPress. This is NOT for Cpanel. You can redirect to any url with this plugin.

Leave a Reply

Get in Touch

Please fill out the form below and we will get back to you ASAP

  • This field is for validation purposes and should be left unchanged.