asp.net 中web.config 生成僞靜態的配置

1.先引用URLRewriter.dll
2.將下列配置信息放置站點根目錄下的web.config即可。

<?xml version="1.0"?>
<configuration>
	<configSections>
		<section name="RewriterConfig" type="URLRewriter.Config.RewriterConfigSerializerSectionHandler, URLRewriter"/>
	 
	</configSections>

	<RewriterConfig>
		<Rules>
			<RewriterRule>
				<LookFor>~/default.html</LookFor>
				<SendTo>~/default.aspx</SendTo>
			</RewriterRule>
		</Rules>
	</RewriterConfig>

	<system.web>
		<httpModules>
			<add type="URLRewriter.ModuleRewriter, URLRewriter" name="ModuleRewriter"/>
			<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
		</httpModules>
	</system.web>

</configuration>


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章