Spage Cat, Prince Among Thieves RSS Feed

301 RewriteRule Generator

I find myself often needing to set up a large number of 301 redirects from an excel file of old to new url’s. Until this point, writing these had been a fairly exhausting process as you need to be certain to escape every character that could be picked up by the regular expression engine, or risk unintended consequences. On top of that, writing these rewrites to catch GET parameters in any order is complex to say the least. While working through a large list of 301s for a very picky server where Redirect 301 style redirects were not an option, I began setting up RewriteRule's by hand and decided there had to be a better way. Voila! My 301 RewritRule Builder was born.

Excel Usage Example

You can simply enter a list of tab or space delimited urls (copied from Excel works great) and it will spit out the generated RewriteRule’s for you. GET parameters on the old urls are broken up and built into multiple RewriteCond’s set up to work in any passed order.

I hope someone finds this useful. Any comments are welcome below, of feel free to fork me on github!

Fork my source on Github!

Comment by: Dan Shields on

Dan Shields GravatarI can't believe no one has commented. This thing is the greatest tool ever. I would have figured someone had created this but when searching not much was showing up and you just saved me hours of converting 6 hundred or so urls.

Thanks so much!!

Comment by: Chandra on

Chandra GravatarHey Buddy, I have no words to express.. This is a great tool and you saved my time a lot .. thank you soooooooo much. God this is a wonderful tool :-)