OK I have been working on multiple approaches to this but can’t really find a viable solution.
We have a legacy site that has sub-domains being used as categories and the url structure looks like this.
http://www.my_category.my_site.com/subcategory/article_123.html
I need to find a way to redirect (using 301’s) to
http://www.my_site.com/articles/my_category/sub_category/article-123
I have looked at nginx redirects (which will not work as you cant modify the path – changing underscores to dashes)
Rails routing doesn’t seem to work with the 2 subdomains (www.mycategory)
Rack Rewrite doesn’t quiet do the trick either (It only redirects to the same sub-domain).
Any ideas on the best approach? I’m not ruling out the above but would like to see what people think?
With nginx it’s easy as ABC: