<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>webinfinite.com &#187; url rewrite</title>
	<atom:link href="http://webinfinite.com/tag/url-rewrite/feed/" rel="self" type="application/rss+xml" />
	<link>http://webinfinite.com</link>
	<description></description>
	<lastBuildDate>Fri, 18 Jun 2010 16:26:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>ASP.Net &#8211; Rewrite URL in VB.Net</title>
		<link>http://webinfinite.com/aspnet/rewrite-url-in-vbnet/</link>
		<comments>http://webinfinite.com/aspnet/rewrite-url-in-vbnet/#comments</comments>
		<pubDate>Sat, 28 Feb 2009 01:46:34 +0000</pubDate>
		<dc:creator>webinfinite</dc:creator>
				<category><![CDATA[Asp.net]]></category>
		<category><![CDATA[url rewrite]]></category>

		<guid isPermaLink="false">http://webinfinite.com/?p=10</guid>
		<description><![CDATA[Application_BeginRequest method of Global.asax file can be used to rewrite the URL of the current page.? Following code snippet shows you how to achieve this goal. &#60;%@ Application Language=?VB? %&#62; &#60;script runat=?server?&#62; Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs) ?This is for dynamic redirection without having to create a directory in the [...]]]></description>
			<content:encoded><![CDATA[<div class="postbody entry">
<p><span id="_ctl0_ContentPlaceHolder1_Label1">Application_BeginRequest method of Global.asax file can be used to rewrite the URL of the current page.? Following code snippet shows you how to achieve this goal.<br />
</span></p>
<p>&lt;%@ Application Language=?VB? %&gt;<br />
&lt;script runat=?server?&gt;</p>
<p>Protected Sub Application_BeginRequest(ByVal sender As Object, ByVal e As EventArgs)</p>
<p style="text-align: left; padding-left: 30px;">?This is for dynamic redirection without having to create a directory in the root folder. We<br />
?needed to change the 404 in IIS under custom errors to /(forward slash) instead of the default 404b.html</p>
<p style="text-align: left; padding-left: 30px;">If Regex.IsMatch(Request.Url.AbsoluteUri, ?404;?) ?Get the url from browser address bar<br />
Dim UrlSplit(), url as String<br />
UrlSplit = Request.Url.AbsoluteUri.Split(??404;?) ?Split the url where the error occured in this case 404<br />
url = replace(UrlSplit(1), ?404;?, ??)<br />
url = replace(url, ?http://www.youraddress.com?, ??) ?Replaces the youraddress.com address and puts nothing</p>
<p style="text-align: left; padding-left: 30px;">?Select Case to check where the page should be redirect too.<br />
Select Case url<br />
Case ?/aboutmypage?<br />
response.Redirect(?/aboutus?) ? Redirects to correct url.<br />
Case ?/yourprogram?<br />
response.Redirect(?/programs/yourprogram?)<br />
Case ?/canucks?<br />
response.Redirect(?/sports/hockey/canucks?)<br />
Case Else<br />
response.redirect(?/help/sitemap/index.aspx?)<br />
End Select<br />
End If<br />
End Sub</p>
<p style="text-align: left;">&lt;/script&gt;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://webinfinite.com/aspnet/rewrite-url-in-vbnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
