1
0
I have several thousand URL's in a CMS formatted like:
/post/en/1539/A+Week+in+Paris+61.html
I'm moving all of the data to wordpress. Where the URL structure will be formated as:
/2011/a-week-in-paris-61/
The post numbers correlate to a date range:
/post/en/1[1-599]/ /2010/
/post/en/1[599-999]/ /2011/
/post/en/2[000-999]/ /2011/
What is the best way to redirect this?
I am not sure I understand correctly. Do you want to parse various text files containing URLs and change them according to the pattern you described? If so, what operating system are you using? – terdon – 2013-01-31T11:19:44.650
Not text files, the URL's must be changed to remove "+" and remove .html so that it matches wordpress's url encoding. The second thing I want to do is automatically add the date to the destination path depending on the original post # so /post/en/1539/A+Week+in+Paris+61.html becomes /2011/a-week-in-paris-61/ – tokyotaco – 2013-01-31T11:28:41.807
Ok, but where are these URLs? Are they not in HTML files (those are text files)? Are they in a database somewhere? And, again, what operating system are you using? This kind of substitution is quite simple on Unix variants. – terdon – 2013-01-31T11:35:13.957
This is all in a mysql db on a linux box, server is nginx. Not in a text file. I'm reluctant to change this in a database on the old server because I need to be able to easily revert. I can download the top 1000 URL's into a text file from google webmaster tools, but I would have to do it again when errors start coming in for the other missing url's, I've been looking into how I can do this as a redirect/rewrite using regex. – tokyotaco – 2013-01-31T11:54:17.400