Quantcast
Channel: General
Viewing all articles
Browse latest Browse all 7363

Using ReWrite to shorten URL the user enters

$
0
0

I am trying to give users a short URL (http://www.gggggg.com/xxxxxxxxxx) that IIS 8 will translate into a longer one (http://www.gggggg.com/cgi-bin/aaaaaaaa?parm1=VAL1&parm2=VAL2&parm3=VAL3&parm4=VAL4&parm5=VAL5) automatically.

Based on some research I did online, I believe the web.config statements below should accomplish this. However, when I attempt to use http://www.gggggg.com/xxxxxxxxxx, I receive a "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed." message. The long URL,http://www.gggggg.com/cgi-bin/aaaaaaaa?parm1=VAL1&parm2=VAL2&parm3=VAL3&parm4=VAL4&parm5=VAL5), works fine.

Can anyone help me with this? I had this functionality working in IIS 6 but IIS 8, which we are migrating to and I am new to, seems to be a whole new beast.

Is this even the best way to do this? If not, what is the better way?

web.config statements:

<?xml version="1.0" encoding="UTF-8"?>

<configuration>
   <system.webServer>
      <rewrite>
         <rewriteMaps>
            <rewriteMap name="eCASAppRewrites" defaultValue="">
               <add key="/xxxxxxxxx" value="/cgi-bin/aaaaaaaa?parm1=VAL1&parm2=VAL2&parm3=VAL3&parm4=VAL4&parm5=VAL5" />
            </rewriteMap>
         </rewriteMaps>
         <rules>
               <rule name="eCASAppRules">
                  <match url="(.*)" />
                     <conditions>
                        <add input="{eCASAppRewrites:{REQUEST_URI}}" pattern="(.+)" />
                    </conditions>
                   <action type="Rewrite" url="{C:1}" />
               </rule>
           </rules>
       </rewrite>
   </system.webServer>
</configuration>


Viewing all articles
Browse latest Browse all 7363

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>