c# - Web Config Redirects -


i have links site, let's call them following: www.mysite.com.au/fly-cruise , www.mysite.com.au/fly-cruise/some-deal.

i both of these types of urls return new page: www.mysite.com.au/packages/flycruise.

i able first 1 working using following in web config file:

<rewrite>   <rewritemaps>     <rewritemap name="flycruise">       <add key="/fly-cruise" value="/packages/flycruise/" />     </rewritemap>   </rewritemaps>   <rules>     <rule name="redirect rule1 flycruise">       <match url=".*" />       <conditions>         <add input="{flycruise:{request_uri}}" pattern="(.+)" />       </conditions>       <action type="redirect" url="{c:1}" />     </rule>   </rules> </rewrite> 

but i'm not sure how specify after fly-cruise/.

do need separate rule this? also, proper term referring trailing part of url?

if want redirect urls starts /fly-cruise , after. example:

/fly-cruise, /fly-cruise/abc, /fly-cruise/bcd etc

you can use single rule that:

<rewrite>     <rules>         <rule name="redirect rule flycruise">             <match url="^fly-cruise" />             <action type="redirect" url="/packages/flycruise" />         </rule>     </rules> </rewrite> 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -