Question : 301 Redirects for Already-Written URLs

Hi, I have IIS 8 and url rewrite rules in place to make the urls friendly by converting the .aspx pages and parameters to a new, rewritten URL.  however, some of my maps have values that have changed, forcing me to have to do 301 redirects from one friendly URL to another.  Here is an example:

From: www.domain.com/friendly-url  needs to be redirected
To: www.domain.com/friendly-url-2

How do you get from one rewritten URL to another?

Answer : 301 Redirects for Already-Written URLs

Capture the {REQUEST_URI}  as /friendly-url and place a rule to forward to your other location.

ex:
 <rule name="URI to URI" stopProcessing="true">
                    <match url="(.*)" />
                    <conditions>
                        <add input="{REQUEST_URI}" pattern="^/friendly-url$" />
                    </conditions>
                    <action type="Redirect" url="http://{HTTP_HOST}/friendly-url2/" />
                </rule>        

-Hades666
Random Solutions  
 
programming4us programming4us