I moved to a new software and now need to catch the old urls and rewrite them to the new ones.
Here is an example:
Old url: http://www.religiousforums.com/forum/neopagan-revival-religions-dir/19088-druid-horoscope-whats-your-sign.html
New url: https://www.religiousforums.com/threads/druid-horoscope-whats-your-sign.19088/
I tried this but it does not work:
location ~* ^/forum/[^/]+/[0-9]+-[^\.]+\.html$ {
rewrite [^/]+/([0-9]+)-[^\.]+\.html$ /threads/$1/ last;
}
What am I missing here? I only need the id in the new url. The text is not important.
Best Answer
Update : not clear what you want to do
If you mean you want to serve from both URLs the same content, then you are doing content duplication and it's a very bad idea. Now to redirect correctly from old URLs to the new ones, you must set this up :
Or simply put this in a common location block :
Edit: This worked: