url rewriting - How to rewrite a URL without leaving the current page in C#? -
i want re-write url without leaving current. find large number of post related url re-writing, did'n success.
i want if user enter url -
http://localhost:16185/company/careerwebsite.aspx?org_name=hire-people url automatically convert format -
http://localhost:16185/hire-people but original page (company/careerwebsite.aspx?org_name=hire-people) not leave.
means, user did't see original url(company/careerwebsite.aspx?org_name=hire-people) in browser. user can see virtual url /hire-people.
thanks help...!!!
well, if want directly same way described need redirect 301 or 302. url-rewriting you'l need install urlrewrite module iis. far you'l need kind of following url-rewrite rule in web.config file:
<rule name="redirectuserfriendlyurl1" stopprocessing="true"> <match url="^company/careerwebsite\.aspx$" /> <conditions> <add input="{query_string}" pattern="^org_name=([^=&]+)$" /> </conditions> <action type="redirect" url="{c:1}" appendquerystring="false" /> </rule>
Comments
Post a Comment