Forum Moderators: phranque
I need to redirect roughly 800 pages formatted like below
Old
http://www.example.com/detail/link-874-ally-web-directory.html
New
http://www.example.com/Internet/Directories/Ally-Web-Directory-874.html
Another Example of the new links would be such
http://www.example.com/Internet/Directories/Paid-Directories/Directory-Monster-269.html
I am looking for .htaccess 301's and I will donate for the solution that doesn't end up in 800'ish manual redirects.
[edited by: jdMorgan at 10:57 pm (utc) on June 10, 2008]
[edit reason] example.com [/edit]
Look for commonalities among the old URLs, while still preserving enough info to generate the new ones; FOr example, if *all* old URLS of the form "/details/<something>" will redirect to new URLs of the form "/Internet/Directories/<something>", then you can write a rule to do all of them, since the last part of the URL *can* be derived from the first, by re-arranging it, moving the "link number," and changing the case on a few letters.
mod_rewrite and mod_alias' RedirectMatch are all about pattern-matching -- The trick is to identify the pattern to identify the URLs that need to be redirected --and those that don't-- based only on what is in the text of those URLs. It is this pattern-matching that allows one rule or directive to redirect more than one URL.
Jim