Hi David,
As I understand, you want to type in the IE address window:
http://www.mywebsite.com/motherboard.aspx (which is not exist)
Then you want to capture this error and redirect to:
http://www.mywebsite.com/products.aspx?category=motherboard
To get this done, I think you should change the error page of 404 page not
found to your customized page my404.html.
This is the content of my404.html:
<script>
DocURL = document.URL;
if (DocURL=="
http://www.mywebsite.com/motherboard.aspx"){
NewDocURL ="
http://www.mywebsite.com/products.aspx?category=motherboard";
window.navigate(NewDocURL);
}
</script>
To change the default of the 404 error page, you should follow bellow steps:
a. Run Internet Service Manger (If you’re using IIS 4.0, you can run it at
Start -> Programs -> Windows NT 4.0 Option Pack -> Microsoft Internet
Information Server -> Internet Service Manager)
b. Expand the Default Web Site and choose the corresponding virtual
directory vd1.
c. Right click vd1 and click Properties.
d. Click Custom Errors Tab and choose the 404 item in the list.
e. Change the Contents to point to the file my404.html
f. Click OK
Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
--------------------
| From: (e-mail address removed) (David C. Taylor)
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: Convert QueryString to regular Url
| Date: 22 Oct 2003 11:46:27 -0700
| Organization:
http://groups.google.com
| Lines: 42
| Message-ID: <
[email protected]>
| References: <
[email protected]>
| NNTP-Posting-Host: 208.16.173.127
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1066848388 23632 127.0.0.1 (22 Oct 2003
18:46:28 GMT)
| X-Complaints-To: (e-mail address removed)
| NNTP-Posting-Date: Wed, 22 Oct 2003 18:46:28 +0000 (UTC)
| Path:
cpmsftngxa06.phx.gbl!cpmsftngxa09.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.su
l.t-online.de!t-online.de!diablo.theplanet.net!news.maxwell.syr.edu!postnews
1.google.com!not-for-mail
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:185859
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Thanks for the input guys. The problem is not manipulating the
| string, the problem is generating and sending the page as a response
| because in my example, the page:
|
|
http://www.mywebsite.com/motherboard.aspx
|
| doesn't actually exist but is an 'alias' for
|
|
http://www.mywebsite.com/products.aspx?category=motherboard
|
| so somehow it is using members of a namespace near or under good old
|
| System.Web.UI.Page
|
| perhaps the Request or Response members.
|
| Thanks for your responses, I'll keep looking into this.
|
| David
|
|
| (e-mail address removed) (David C. Taylor) wrote in message
| > I saw an article that described how to convert the query string into
| > an Url without a query string and return the page.
| >
| > For example, this request:
| >
| >
http://www.mywebsite.com/products.aspx?category=motherboard
| >
| > becomes something like this:
| >
| >
http://www.mywebsite.com/motherboard.aspx
| >
| > I need to do that or something like it. The problem is, I cannot put
| > my hands on that article. It could have been anywhere from a dozen
| > magazines, dozens of websites, or dozens of newsletters. I really
| > wish I had bookmarked it. If anyone can point me to any resources
| > describing this technique I would be highly appreciative.
| >
| > Regards,
| >
| > David Taylor
|