HomeAbout UsWebsite DesignWeb Design FAQ'sSEOVideoBlogTestimonialsPortfolioContact

WEBSOURCE LLC is a website design company based in Dayton Ohio. Read more from our Blog or catch us on Twitter.

301 Redirects for static pages on Windows

How to create 301 Permanent Redirects for static html pages on Windows/IIS.

When moving webpages, it is extremely important to use correct 301 redirects to retain pagerank. On Apache, you can use .htaccess files or PHP code. On Windows Servers you can use ASP or ASP.NET to permanently redirect ASP pages from one place to another. Well, that's great for ASP pages, but how do you properly redirect static .htm or .html documents on a Windows Server without using ASP code?

Yes, you can use the meta-refresh - but this won't give you the protection of the permanent 301 redirect and save your page rank - at least as far as Google goes. In order to use a 301 redirect on a Windows server for html pages, you either need to either 1. use IIS, or 2. trick your server into using ASP or ASP.NET.

1. IIS Redirect

In Internet Information Services Manager, right click on the file or folder you wish to redirect Select the radio titled "a redirection to a URL". Enter the redirection page Check "The exact url entered above" and the "A permanent redirection for this resource" Click on 'Apply'. It's THAT easy!

(If you are using shared hosting and/or do not have remote desktop access to your server, you will need the help of your website administrator).

2. Getting HTML pages to run ASP Code

Another more creative way to redirect static documents is to have html pages execute ASP code.
In IIS, right click the site and choose properties. Go to the home directory and click on configuration. Here it lists all the extensions. .html or .htm are not listed in there, since they don’t need applications. Add .htm and/or .html using the the same path as for ASP (or ASP.NET if that’s what you want to use)

Now, html docs will execute the asp code! And you can use:

<%@ Language=VBScript %>

<%Response.Status="301 Moved Permanently" Response.AddHeader "Location", "<a href="http://www.newdomain.com/newpage.htm">http://www.newdomain.com/newpage.htm</a>"%>

Of course, using this option means you could theoretically run any ASP code on a html page.
Interesting :-)

 

Posted: 7/26/09
Bookmark and Share
© WEBSOURCE LLC 2010 | Small Business Website Design Dayton Ohio
Beavercreek, Ohio, 45430

Visa Mastercard
Visa & Mastercard Accepted
Website Design · Content Management · Ecommerce
Search Engine Optimization (SEO) & Search Marketing (PPC)

Valid HTML 4.01!