Getting the URLs from htaccess rewriterule

illuminateme

Power Member
Joined
Feb 24, 2016
Messages
774
Reaction score
369
Have anyone else had to work with an old massive redirect list that's thousands of lines long?

Is there a tool/reliable way to grab the origin url and destination url from a bunch of rewriterule from htaccess and dump it into a spreadsheet?

or better yet, a tool that can identify and eliminate duplicates and compress the redirect chains?

thank you in advance!
 
I don't know about an existing tool, but it wouldn't be too difficult to write a script to handle this.
 
You should just be able to copy and paste all the URLs into a spreadsheet and have all the URLs end up in unique cells. You could then use a formula in excel to separate the URLs (assuming they didn't automatically go into their own cells when you paste them in the spreadsheet). I haven't worked with a .htaccess file much larger than several hundred lines but a combination of using spreadsheet features as well as search and replace features in notepad++ should be relatively painless (and has worked well for me ).

Also, this post outlines how to manage data like you're talking about using a combination of Screaming Frog and Excel (there are some formulas in there as well you could try).

salt[dot]agency/blog/how-to-deal-with-huge-amounts-of-redirects-in-a-seo-migration/

And not sure if this rewrite generator would be useful.

donatstudios[dot]com/RewriteRule_Generator

Hope that helps.
 
You should just be able to copy and paste all the URLs into a spreadsheet and have all the URLs end up in unique cells. You could then use a formula in excel to separate the URLs (assuming they didn't automatically go into their own cells when you paste them in the spreadsheet). I haven't worked with a .htaccess file much larger than several hundred lines but a combination of using spreadsheet features as well as search and replace features in notepad++ should be relatively painless (and has worked well for me ).

Also, this post outlines how to manage data like you're talking about using a combination of Screaming Frog and Excel (there are some formulas in there as well you could try).

salt[dot]agency/blog/how-to-deal-with-huge-amounts-of-redirects-in-a-seo-migration/

And not sure if this rewrite generator would be useful.

donatstudios[dot]com/RewriteRule_Generator

Hope that helps.

That's basically the exact opposite of the problem I'm facing. I don't need help generating a list. I already have the list of 301s that was built manually over the years by multiple people, encased in htaccess rewriterule's, now i need to strip them of their regex syntax and oddities and manage them in a spreadsheet.
 
Back
Top