Rewriting only part of the URI
I have a script already in use that does something similar, but saves the leading digits based on a specific length of the filename. In this case, all articles have a different number of characters, therefore I cannot use that rule.
I'd be thankful if anyone could point me in the right direction. Here's an example:
FROM:
http://ourdomain.com/newsletters/Directory2/*
TO:
http://ourdomain.com/newsletters/Directory3/*
The asterisk implies that we need to take the name of the article and pass it along as well, while simply rewriting Directory2 to Directory3:
FROM:
http://ourdomain.com/newsletters/Directory2/some-article.aspx
TO:
http://ourdomain.com/newsletters/Directory3/some-article.aspx
Perhaps I am thinking way too hard about this. I need to try and preserve everything EXCEPT for the directory after /newsletters/. I can't just pass:
http://ourdomain.com/newsletters/Directory3/[HTTP::uri]
as this would duplicate part of the URI making it look like this:
http://ourdomain.com/newsletters/Directory2/newsletters/Directory3/some-article.aspx
So that's why I'm a bit confused....Do I need to perform some sort of scanning using the URI basename, or simply rewrite based on the URI::path?
I appreciate any help!