Link to home
Start Free TrialLog in
Avatar of webressurs
webressursFlag for Norway

asked on

URL Rewrite / mapping in asp.net

I use the URL rewrite module in web.config to make canonical URL. That works perfect.

Now I want to make some easy "shortcut" urls that is mapped to the original long url.

Example:

If user writes http://www.example.com/contact/ that url should point to this spesific url (not redirected if possible): http://www.example.com/templates/sections/common/module.aspx?id=5790

I tried this, but no luck:

<rewrite>

  <rewriteMaps>
    <rewriteMap name="Redirects">
      <add key="/contact/" value="/templates/sctions/common/Module.aspx?id=5790" />
    </rewriteMap>
  </rewriteMaps>

  <rules>
    <rule name="CanonicalHostName" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTP_HOST}" pattern="^www\.nettdating\.no$" negate="true" />
      </conditions>
      <action type="Redirect" url="http://www.nettdating.no/{R:1}" />
    </rule>
  </rules>

</rewrite>

Open in new window


How do I make (static) friendly URLs like I try to do here?
ASKER CERTIFIED SOLUTION
Avatar of webressurs
webressurs
Flag of Norway image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of webressurs

ASKER

This worked perfect!