Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Tricky URL Rewrite question

Reply
Thread Tools

Tricky URL Rewrite question

 
 
aag
Guest
Posts: n/a
 
      09-15-2008
Hey there! I've got an URL rewrite issue that I'm wondering if the
masters out there can help with

I have a site that resides at (for example) foo.com - it's a full
site with tons of pages that users would need to get access to.

However, I'd like to have a special feature of that same ASP.NET
application such that if a users goes to:

bla.foo.com/name

It would actually redirect via URL rewrite to foo.com/function.aspx?
ident=<i>name</i>

Is that possible? Or do I need to write an HTTP handler to intercept
ALL http traffic, search for the URL, forward if necessary, or pass on
to the default handler if not? (how do you pass a request on to the
default handler in an HTTP Handler, anyway?)

 
Reply With Quote
 
 
 
 
Göran Andersson
Guest
Posts: n/a
 
      09-15-2008
aag wrote:
> Hey there! I've got an URL rewrite issue that I'm wondering if the
> masters out there can help with
>
> I have a site that resides at (for example) foo.com - it's a full
> site with tons of pages that users would need to get access to.
>
> However, I'd like to have a special feature of that same ASP.NET
> application such that if a users goes to:
>
> bla.foo.com/name
>
> It would actually redirect via URL rewrite to foo.com/function.aspx?
> ident=<i>name</i>
>
> Is that possible? Or do I need to write an HTTP handler to intercept
> ALL http traffic, search for the URL, forward if necessary, or pass on
> to the default handler if not? (how do you pass a request on to the
> default handler in an HTTP Handler, anyway?)
>


You can put code in the Application_BeginRequest method in global.asax
to check the url of every request that reaches the ASP.NET engine.
However, that only works for requests that actually are handled by
ASP.NET, which an url like bla.foo.com/name is not.

The same goes for an HttpHandler, it can only catch requests that are
handled by ASP.NET.

We use a component named IIS Mod-Rewrite. It's an ISAPI dll that gets
installed in the web application in IIS, and it intercepts the request
before it's handled.

There are some free components out there also, unless your server is 64-bit.

--
Göran Andersson
_____
http://www.guffa.com
 
Reply With Quote
 
 
 
 
aag
Guest
Posts: n/a
 
      09-15-2008
Unfortunately, we are indeed using 64 bit - however, I'm pretty sure
we're using "urlreqwriting.net" already. I'll have to see how that
works... do you think that could do the job for us?

We're running Windows Server 2008 and IIS7, so that might give us some
additional leeway in forwarding all requests to the ASP.NET handler,
but I'm not quite sure on the exact steps I should take for that.

However - you're sure that bla.foo.com/name wouldn't be handled by
ASP.NET? I mean, doesn't it attempt to look for default.aspx in the
directory "bla.foo.com/name", or does it do a redirect first before
being processed by ASP.NET?

Thanks for answering and helping...! It's greatly appreciated.




On Sep 15, 5:48*am, Göran Andersson <(E-Mail Removed)> wrote:
> aag wrote:
> > Hey there! *I've got an URL rewrite issue that I'm wondering if the
> > masters out there can help with

>
> > I have a site that resides at (for example) *foo.com - it's a full
> > site with tons of pages that users would need to get access to.

>
> > However, I'd like to have a special feature of that same ASP.NET
> > application such that if a users goes to:

>
> > bla.foo.com/name

>
> > It would actually redirect via URL rewrite to foo.com/function.aspx?
> > ident=<i>name</i>

>
> > Is that possible? *Or do I need to write an HTTP handler to intercept
> > ALL http traffic, search for the URL, forward if necessary, or pass on
> > to the default handler if not? *(how do you pass a request on to the
> > default handler in an HTTP Handler, anyway?)

>
> You can put code in the Application_BeginRequest method in global.asax
> to check the url of every request that reaches the ASP.NET engine.
> However, that only works for requests that actually are handled by
> ASP.NET, which an url like bla.foo.com/name is not.
>
> The same goes for an HttpHandler, it can only catch requests that are
> handled by ASP.NET.
>
> We use a component named IIS Mod-Rewrite. It's an ISAPI dll that gets
> installed in the web application in IIS, and it intercepts the request
> before it's handled.
>
> There are some free components out there also, unless your server is 64-bit.
>
> --
> Göran Andersson
> _____http://www.guffa.com- Hide quoted text -
>
> - Show quoted text -


 
Reply With Quote
 
CJM
Guest
Posts: n/a
 
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UpdatePanel ( url rewrite) 2nd post back url changes Martin ASP .Net 0 04-28-2010 11:47 AM
a tricky if else(maybe not tricky but impossible) nirkheys@gmail.com C Programming 9 04-25-2006 06:13 PM
CSS URL rewrite fangyong.F@gmail.com Cisco 1 01-18-2006 04:38 PM
Rewrite asp url as aspx url? =?Utf-8?B?VA==?= ASP .Net 5 07-24-2005 05:58 PM
Url rewrite question Patrick.O.Ige ASP .Net 0 07-08-2005 07:07 AM



Advertisments