Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Redirecting all links below a subfolder IIS7

Posted on 2015-02-24
1
Medium Priority
?
223 Views
Last Modified: 2015-04-09
Hi all,

I'm having an issue applying a redirect on IIS7, Windows Server 2008 R2.

I need every link after a certain subfolder to redirect to a different domain with the same folder structure.

example:

www.exampleolddomain.com/sub-folder/example1

to redirect to

www.newdomain.com/sub-folder/example1

and

example:

www.exampleolddomain.com/sub-folder/example2

to redirect to

www.newdomain.com/sub-folder/example2

etc.

I need one redirect to to cover any and all sub-subfolders, I assume with some kind of wildcard?

I have tried switches

$V and $P without success, but not 100% sure I applied them correctly.

Any help and/or successful examples would be gratefully appreciated.

Thanks
0
Comment
Question by:ncomper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 28

Accepted Solution

by:
Dan McFadden earned 2000 total points
ID: 40658258
You can add this to the web config file of the website:

<rewrite>
     <rules>
         <rule name="Redirect old domain to new domain" patternSyntax="Wildcard" stopProcessing="true">
             <match url="*" />
             <conditions>
                 <add input="{HTTP_HOST}" pattern="old-domain-name.com" />
             </conditions>
             <action type="Redirect" url="http://www.new-domain-name.com/{R:0}" />
         </rule>
     </rules>
 </rewrite>

Open in new window


The {R:0} maintains the path of the original request.

Dan
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is an ISAPI filter?   •      It's an assembly (.dll file) that can add or change the way IIS works.   •      They can be enabled globally for your web server or on a site-by-site basis.   When the IIS server receives a request, enabling the ISAPI fi…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question