Solved

Redirecting all links below a subfolder IIS7

Posted on 2015-02-24
1
220 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 500 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

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 are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
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…

630 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