Home Use Web.Config to redirect to a different folder name
Reply: 0

Use Web.Config to redirect to a different folder name

world of simpsons
1#
world of simpsons Published in 2018-01-12 20:10:55Z

I have 2 websites and a few thousands links with the same pattern that need to be redirected. I want to achieve this by writing the code one time and for it to work for all of the URLs.

This is the pattern I need to redirect from:

http://sub.domain1.com/index.cfm/pg/resources/lcid/358/_Example

This is the pattern I need to redirect to:

http://domain2.com/index.cfm/pg/resourceDetail/lcid/358/_Example

At the moment this is the way I am doing this but I have to do this for each page:

<rewrite>
<rewriteMaps>
<rewriteMap name="Redirects">
<add key="/index.cfm/pg/resources/lcid/358/_Example" value="http://domain2.com/index.cfm/pg/resourceDetail/lcid/358/_Example" />
</rewriteMap>
</rewriteMaps>
</rewrite>

Are there any better ways to do this without having to do it for each page?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305781 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO