asp.net - Web Config Rewrite/redirect -


i working on existing project did not create.

in web.config file, there number of redirects, setup in following way:

    <rewritemaps>         <rewritemap name="redirects">           <add key="/findyourlocalbranch/" value="/find-your-local-branch/" />         </rewritemap>     </rewritemaps> 

it seems me rewrite rule being used these redirects, said, did not write , not in position change this. not sure if right or wrong.

my problem need implement following redirect:

<add key="/need-a-loan/.htm" value="/need-a-loan/" /> 

but brings whole site down - suspect due syntax error in line.

i suspect error '.' after '/'

my question is, can - there nothing on internet can find this.

basically, want redirect one, specific url given url???

i can't whats going on map, without corresponding rule i'm blind.

but, rewrite rule redirect /need-a-loan/.htm /need-a-loan/.

    <rewrite>         <rules>             <rule name="need-a-loan" stopprocessing="true">                 <match url="need-a-loan/.htm" />                 <action type="redirect" url="need-a-loan/"  redirecttype="permanent"  />             </rule>         </rules>     </rewrite> 

note: doesn't use map, you'd remove entry.

that give 301. if want different type, can adjust rediecttype. e.g. temporary give 307.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -