Free templates
Menu Search Free templates

URL rewrite and 301 redirect in IIS 7 (C#, VB and ASP.NET) | Free code

Here you can download free code (C# and VB) for URL rewrite and 301 redirect in IIS 7 for a website that runs on a web server with IIS 7 and ASP.NET 4.0.

URL rewriting involves the creation of user-friendly URLs in links on a website based on how you want that indexed URLs should look like in search engines and the rules for how user-friendly URLs should be rewritten to URLs with parameters. The parameters in a URL contains data that is loaded into the code in a web page and a URL rewrite of a user-friendly URL means that these parameters can be retrieved.

When IIS 7 is used as a web server is it easier to do URL re-writing than it is to do a URL rewrite in IIS 6. When IIS 7 is applied as a web server for a website, you only have to specify the rules for URL rewriting in the "Web.config" file and you do not have to write any code to implement URL rewriting on the website. In IIS 7 does not user-friendly addresses need to have extensions, it is possible to create user-friendly URLs without file extensions.

To do URL rewrites in IIS 7 you need to install "IIS URL Rewrite 2.0" which can be downloaded from the official website for IIS (www.iis.net). With the help of "IIS URL Rewrite 2.0" is it easy to create rewrite rules for user-friendly URLs that are saved in the "Web.config" file for the website. With the help of "IIS URL Rewrite 2.0" can you also create 301 redirects for a website and this is done with one rewrite rule and a "rewriteMap" where the specific redirects are made.

This template with free code (C# and VB) for URL rewrite and 301 redirect in IIS 7 includes four web forms and a SQL database where we have created user-friendly links for categories, pages and individual articles. In this template we have created rewrite rules in the "Web.config" file using "IIS URL Rewrite 2.0" and 301 redirect for two URLs.

We have used Microsoft Visual Web Developer 2010 Express to create the website with URL rewrite and 301 redirects. You can test this template on your local computer by copying the contents to "C:\inetpub\wwwroot" and then enter "localhost" in your browser, provided that you have IIS 7 installed on your computer. There is a "Default Web Site" in IIS 7 that uses an application pool that is running IIS 7 in Integrated mode using ASP.NET v4.0. In IIS 7 can you use an application pool that is running in Classic mode for websites that are not adapted to IIS 7, provided that the Windows feature of backward compatibility for IIS 6 has been activated.
Updated: 01/01/2015 | Created by All-templates.biz

Download URL rewrite and 301 redirect in IIS 7 (C#, VB and ASP.NET) | Free code ยป

Tags: web code seo seo optimizing