dimanche 28 juin 2015

IIS Url Rewrite with Special Characters in Route

I am using Asp.Net with Angular JS in my project. I want to create my route like below.

Required Url Format: http://localhost:9196/hotelname-cityname

eg: http://localhost:9196/magnolia-bengaluru

I want to redirect this route to my one of angular routes. Please help me on this.

Url Rewrite Code Web.Config

<rewrite>
 <rules>
  <rule name="RezEPropertyUrl" stopProcessing="true">
   <match url="^/*." />
   <action type="Redirect" url="/{R:2}-{R:1}" redirectType="Found"  />
  </rule>
 <rule name="RezEDefaultPage" stopProcessing="true">
  <match url="^Property/Cart" />
  <action type="Rewrite" url="/home.html" />
</rule>

Aucun commentaire:

Enregistrer un commentaire