Click here to Skip to main content
Click here to Skip to main content
Articles » Web Development » ASP.NET » Howto » Downloads
 
Add your own
alternative version
Go to top

URL Rewriting using ASP.NET for SEO

, 25 Feb 2009
An article describing how to implement URL rewriting in ASP.NET using three different methods
Url-Rewriting-in-ASPNET.zip
UrlRewriterSample
App_Code
App_Data
UrlRewriterSampleWithoutIIS.zip
UrlRewriterSampleWithoutIIS
App_Code
App_Data
<?xml version="1.0" encoding="UTF-8"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
	<appSettings />
	<connectionStrings />
	<system.web>
		<httpHandlers>
			<add verb="*" path="*.html" type="BetterUrlRewriter" validate="false" />
		</httpHandlers>
		<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
		<compilation debug="true">
		</compilation>
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authentication mode="Windows" />
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
	</system.web>
    <system.webServer>
        <handlers>
            <add name="*.html_*" path="*.html" verb="*" type="BetterUrlRewriter" preCondition="integratedMode,runtimeVersionv2.0" />
        </handlers>
        <validation validateIntegratedModeConfiguration="false" />
    </system.webServer>
</configuration>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Steve Riggall
Technical Lead Hidalgo Limited
United Kingdom United Kingdom
Steve is an MCP and senior software developer for Hidalgo Limited (http://www.hidalgo.co.uk).

| Advertise | Privacy | Mobile
Web02 | 2.8.140916.1 | Last Updated 25 Feb 2009
Article Copyright 2009 by Steve Riggall
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid