Magento: Import/Export URL Rewrites Module

I am currently working on a module that allows you to import/export URL Rewrites in Magento. This project spawned off me having to setup about 70 301 redirects when moving an older site onto Magento. I like that Magento has a URL rewrite manager, but having to enter each one in manually is a pain.

So, this module is currently underway. I have it successfully importing and exporting rewrites. However, I want to make it more robust and user-friendly. That being said, I am hoping to get some feedback and ideas from you on what types of features you’d like to see in a module such as this. Some ideas I already have are:

  • Nice admin interface allowing you to easily import/export, as well as explain what all the different fields are, and how to properly use them for different rewrite needs
  • Error log displayed after import if any rows had errors. Will display the line # on the csv file along with the specific error
  • Simplified, more human-readable values in the CSV. For example, if you are doing a 301 redirect, you’d need to put the value of “RP” in the ‘Options’ column. Perhaps change “RP” to “301” or something that is more clear
  • Allow for a way to remove rewrites if the row is specifically flagged for removal (removal of rewrites is a one-by-one process now)

Please comment with any ideas you’d like to add to the list. This will most likely be a paid module, fyi. Unless it turns out to be crazy ridiculous awesome, you can expect that it will be less than $50.

This entry was posted in Magento. Bookmark the permalink.

6 Responses to Magento: Import/Export URL Rewrites Module

  1. Lee Young says:

    When you change your url, Along time Google maybe index your site.

  2. RW says:

    Did you ever complete the import of URL rewrites? I have over 10000 old urls i need to redirect and the idea of doing them manually is unbearable. I am willing to pay for it.

  3. Jeffrey says:

    Hey Josh, have you seen this community extension from Velite? It handles rewrites for noRoute/404 URLs.

    They didn’t create an admin interface for it, which to me is very nice, the less time I have to spend in Magento’s admin area the better.

    There’s no importing/exporting to the DB, all your rewrites are contained in a CSV file. Would storing the rewrites in the database give better performance?

    I like this module because it’s simple, fast, and easy to use. I set up several thousand rewrites for our store without any difficulties.

    But there are two features it is missing that I would love to have in a rewrite module. Wildcards and Keywords.

    Wildcards are simple, I think you already know how those could be helpful when migrating a store to a new platform. Our old product page URLs used to have a standard base URL and also appended variables based on your navigation history, sadly all those URLs with variables would now 404 because we don’t have wildcards.

    Keywords I envision working like this…
    This explanation is based on velite’s structure which is two columns in a CSV file. old-URL;new-URL, we’ll be using keywords in the first column instead so it will be keywords;new-URL. For performance reasons the keyword rewrites could follow directly after the exact match rewrites in the same CSV file. We’ll just need a spacer or title row between the two so the parser knows it is now looking at keywords. I believe some old URLs could contain commas so the spacer row would be necessary to differentiate them, the other solution would be to add another column and specify what type of rewrite it is. I would prefer the first solution because it is simpler and probably has better performance. And because matching exact match / wildcard rewrites should take precedence over matching keyword rewrites, so keeping them in order of importance in the CSV makes sense. Since your module’s rewrites are managed in the database it makes more sense to specify the type of rewrite so you can sort by type when parsing.

    Keyword rewrites could be beneficial for a store which previously had a lot of content pages or product pages which didn’t follow a specific URL pattern making the use of wildcards ineffective.

    Example – Sports Player Names:


    The wildcards around a keyword are implied, it’s actually matching the URL against *favre*. In this instance no other keywords like brett-favre or brettfavre are needed because favre is a unique last name and will match all the intended URLs.

    You could make keywords even more useful and robust by adding tags for ‘and’, ‘or’, and ‘does not contain’. ‘and’ would be necessary when making subsets of popular keywords. And where you need ‘and’ you’ll also need ‘or’ to keep the number of rewrite definitions to a minimum.

    brett[and]packers; (multiple Bretts in NFL)

    Remember keywords are surrounded by implied wildcards so the keyword autograph would also match autographs and autographed.

    I think this should be enough to give you some ideas.. I should get back to work lol.

  4. Loopion says:

    Idea: create a scanning tool for saving all old URL’s into the Magento URL Rewrites.

    I will have soon the case where we need to redo a custom made e-commerce website and they had their own URL rewrites. So I’d like to preserve them and redirect it to each product. The hard task would be to crawl all the URL’s from the current website and next import them into Magento.

    I think it would be useful to have a crawler tool that makes you all the job (ideally this will be run before going in production)

    • Josh Pratt says:

      A cool idea, no question. But, as I assume you know, that would be quite difficult, especially given the countless number of variables and ways that other sites do urls and/or handle rewrites. Seems like it would have to be custom built on a case-by-case basis (unless I’m missing something).

  5. Pingback: Tweets that mention Magento: Import/Export URL Rewrites Module | Prattski | Magento & Web Development --