Quantcast
Channel: All Forums
Viewing all articles
Browse latest Browse all 27852

RewriteMap any directory name and append to querystring

$
0
0

A community member posted a similar thread but I had a twist to the resolution:  I want to redirecthttp://mydomain.com/1234 (where 1234 could be any value [number, char, dash] up to 40 characters) tohttp://mydomain.com/uri.php?a=1234.  As you will notice, I'm also trying to pass the "Key" to my querystring as $1.

I really appreciate the communities help.  Here is my vs2010 web.config code:

        <rewrite>
            <rewriteMaps>
                <rewriteMap name="StaticRedirects">
                    <add key="^.*\/?.*$" value="uri.php?a=$1" />
                </rewriteMap>
            </rewriteMaps>
            <rules>
                <rule name="Redirect Rule" stopProcessing="true">
                    <match url=".*" />
                    <conditions>
                        <add input="{StaticRedirects:{REQUEST_URI}} pattern="(.+)" />
                    </conditions>
                    <action type="Redirect" url="http://pinnedurl.com/{C:1}" appendQueryString="False" redirectType="Permanent" />
                </rule>
            </rules>        
        </rewrite>


Viewing all articles
Browse latest Browse all 27852

Trending Articles