Click here to Skip to main content
15,667,014 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have created a URL shortening which converts

into http://localhost:9909/vrUD4r

now when i hit url http://localhost:9909/vrUD4r it goes to error page!

how can i transfer/redirect http://localhost:9909/vrUD4r to http://localhost:9909/default.aspx?vrUD4r

note that value after http://localhost:9909/ can be any 6 character alphaneumeric! i.e. it can be http://localhost:9909/vrUD4r http://localhost:9909/abCD4E OR http://localhost:9909/ab342D for the different shortened urls.

i manage to shorten the long url, but how can i redirect to original url when i enter short url. i.e. if i enter http://localhost:9909/vrUD4r it must redirect me to original url :

What I have tried:

I have added default page when i hit http://localhost:9909 it goes to http://localhost:9909/default.aspx
as follows :
     <add value="shrtn.aspx" />

also i have tried adding rewrite rule in web.config as follows :

    <rule name="redirectRule" stopProcessing="true">
      <match url="^/*$" />
      <action type="Redirect" url="/shrtn.aspx/{R:0}" redirectType="Found"/>
Updated 17-May-18 21:33pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900