homepage Welcome to WebmasterWorld Guest from 54.237.213.31
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Adding multiple 301 redirects in IIS7
Practically, how can I get hundreds added?
bhonda

5+ Year Member



 
Msg#: 4529633 posted 1:04 pm on Dec 19, 2012 (gmt 0)

So, long story short, I've got a site that is changing its entire structure, but staying on the same domain. I need to add a whole bunch of 301 redirects from old pages to the new.

That's fine. The problem, is that we're talking hundreds of redirects.

I'm not interested in reasons why this move is a bad idea, only the practicalities of how I can get these redirects implemented in the shortest amount of time.

Is there a way to 'batch add' redirections to IIS7?

Essentially, I will have a list of 'Old' links and the corresponding 'New' links.

Any ideas?

 

phranque

WebmasterWorld Administrator phranque us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



 
Msg#: 4529633 posted 1:40 pm on Dec 19, 2012 (gmt 0)

there are several ways to do this but here is a supported extension that would probably work for you.

URL Rewrite Module : The Official Microsoft IIS Site:
http://www.iis.net/learn/extensions/url-rewrite-module [iis.net]

dstiles

WebmasterWorld Senior Member dstiles us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4529633 posted 9:37 pm on Dec 19, 2012 (gmt 0)

I do a similar thing but using the 404 (missing page) response.

You can edit the 404 error response in IIS Manager to direct it at a file in (eg) the site's root. In that 404 processing page (typically an ASP file), detect the filename and issue a new one, remembering to add the 302 or 301 code in place of the 404. As a final trap, if the page isn't recognised within this list then issue a real 404.

g1smd

WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4529633 posted 9:47 pm on Dec 19, 2012 (gmt 0)

If there is a pattern to the old and new URL pairs, then you might only need one or two rules to redirect hundreds of different URL requests to their new location.

bwnbwn

WebmasterWorld Senior Member bwnbwn us a WebmasterWorld Top Contributor of All Time 5+ Year Member



 
Msg#: 4529633 posted 9:42 pm on Jan 14, 2013 (gmt 0)

Most here assume it is a database driven site you didn't state that. Is it a database drivern site or an older site in static htm pages? Makes a big difference trying to get the best answer.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved