Hi, I have a site with this type of URLs: http://subdomain.example.com/title-of-an-article
I have to redirect (301) a few thousands of these to another application in which URLs look like: http://example.com/category/title-of-an-article/1234
When a request arrives I use a RewriteMap prg with a php script to lookup the 'title-of-an-article' on a mysql table and obtain the new URL in the form 'category/title-of-an-article/1234'. I add the 'http://example.com' and spit it back to apache to issue the 301 redirect. That works well.
Now, my problem is that not all URLs need to be redirected and there's no way to tell from the URL itself. The logic to rewrite or not is based on whether the URL is found or not in the database... but when it's not found I can't redirect to the same URL because it would go into a loop... So, how do I tell apache to serve the originally requested URL at this point?
I am very new to mod_rewrite so I don't even know if I'm on the right track here. Any help will be appreciated.