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?
ASP.NETMicrosoft IIS Web Server.NET Programming

Avatar of undefined
Last Comment
webressurs
ASKER CERTIFIED SOLUTION
Avatar of webressurs
webressurs
Flag of Norway image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of webressurs
webressurs
Flag of Norway image

ASKER

This worked perfect!
.NET Programming
.NET Programming

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.

137K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo