Solved

IIS 7 URL Redirects

Posted on 2015-02-06
5
97 Views
Last Modified: 2015-02-26
Windows server 2008 r2 / IIS 7.0

I have a few thousand property listings pages that are indexed by search engines,
here is an example url: http://www.mysite.com/12345/123-myStreet-myCity-myState.html

I need to redirect to: http://www.mysite.com/A12345/123-myStreet-myCity-myState.html

As my Listing ID numbers will soon be updated to prepend an "A".

 Is this possible to do this without manually writing a redirect for each individual page?

Thanks!
0
Comment
Question by:Bang-O-Matic
[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
  • 2
  • 2
5 Comments
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 40594684
There's a url re-write utility that you can install to accomplish this.  

Here's a walkthrough on how to use it:
http://www.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-video-walkthrough

Essentially download and install the module, then you'll be able to configure a rule to append the A in your link.
0
 

Author Comment

by:Bang-O-Matic
ID: 40595608
Hi Kyle,
I already have url rewrite mod installed.
I was looking for guidance on configuring the rule. Sorry i wasnt more specific.
0
 
LVL 17

Assisted Solution

by:Lucas Bishop
Lucas Bishop earned 250 total points
ID: 40596534
I believe this back reference will achieve your goal:

                <rule name="Redirect" stopProcessing="true">
                    <match url="^12345$|^12345/(.*)" />
                    <action type="Redirect" url="A12345/{R:1}" appendQueryString="true" />
                </rule>

Open in new window

0
 
LVL 40

Accepted Solution

by:
Kyle Abrahams earned 250 total points
ID: 40599084
from:
http://forums.iis.net/t/1169518.aspx
 <rewrite>
            <rules>
        <rule name="RewriteSubFolder" stopProcessing="true">
   <conditions>
                        <add input="{HTTP_HOST}" pattern="^www\.site1\.com$" />
                        <add input="{URL}" pattern="^/A$" />
                    </conditions>
               <action type="Rewrite" url="/A{R:0}" />
   </rule>
            </rules>
        </rewrite>
0
 

Author Comment

by:Bang-O-Matic
ID: 40633621
I havent had a chance to test this yet, but I'm going to go ahead and award the points. Thanks for the help!
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
Some of the SEO trends we might expect in 2017.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.

756 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