Forum Moderators: phranque

Message Too Old, No Replies

Old to New Redirect Issue

         

floppydrivez

5:45 am on Jun 10, 2008 (gmt 0)

10+ Year Member



Man I have really backed myself into a corner here. I recently did some changes in my directory and while I like the changes, I also created a pesky issue.

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]

jdMorgan

10:25 pm on Jun 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Since your new URL cannot be derived or inferred from the old URL, there is no "shortcut" solution. I don't see a way to derive "/Internet/Directories" from the old ULR's "/details", for example.

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

floppydrivez

10:36 pm on Jun 10, 2008 (gmt 0)

10+ Year Member



Well the good news is the categories only go 3 deep, so a pattern could form.

1 deep
2 deep
3 deep etc

Its something I just gotta spend more time with.