(651) 237-9922

301 Redirects on IIS using ASP

If you are reading posts about "Google's Duplicate Content Penalty" in reference to sites that your site could be reached at www.mydomain.com and mydomain.com, with the common remedy of using a 301-redirect, but run your site on IIS, this article is for you. The 301 code cited was undoubtedly Apache-targeted, in the form of a sample htaccess file and which isn't really applicable to you.

In terms of options for 301-redirects on IIS, what I found on the web was interesting:
1) Pure IIS based redirects (via the IIS MMC Snap-in and the metabase)
2) ISAPI Redirect Filters - seemless integration into the webserver itself
3) ASP (woohoo!)

For IIS based redirects, the problem (if you don't want to pay for an ISAPI filter) is that not only do you need admin-access-with-GUi-shell to the server, but you also had to create a separate instantiation of each site, one with the 301-redirect, and then another with the real site. Doubling up the instantiations could press the limits of the metabase on 200+ domain servers (and this is for 2GHz 1GB RAM machines). We could solve the admin-access-with-GUi-shell with some swift ADSi code, but why bother?

In walked the solution:

This website is trully a resource for people doing ASP code, and highly recommend reading through his other articles. Evolved Code's samples will need som extensions for proper 301 redirects if you are handling more than one page that needs this functionality, but it will definitely get you started.

Another site with good example code for .NET is:

Happy Redirecting!

Why Choose MagicLamp Networks?

Results-Driven. Focused on Your Success.

We know that your website is a financial asset to your business. We're here to help you reach your business goals and get you the highest possible return on your investment. Our clients' ROI is how we measure our success.

Business-Specific Design.

We help you assess your business needs quickly and accurately, identify what sets you apart from the pack, and communicate it in ways that make clients listen. Because we build sites from the ground up, we can give you the most effective custom tools for marketing your specific products or services.

Complete End-to-End Services.

Don't have your own designer? Not sure how to word your mission statement? No problem. Whether it's branding, copywriting, or full-service technical support, MagicLamp provides everything you need to build a complete web presence.

Online Marketing Expertise.

We use current "white hat" SEO practices to push your site high up in search result ratings so you see traffic rolling in as quickly as possible.

Over 20 Years Of Client Partnerships.

We’ve been making websites since the internet was young. We build long-term relationships with our clients based on results. Many of our current partners have trusted us with their online success for over 5 years.

Websites that Work the Way You Do.

Our sites work the way you do, not the other way around. There's no need to change the way you already do business when you choose Magic Lamp. We’ll make sure your website complements your workflow without complicating it.