Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > url rewriting with no extension in url

Reply
Thread Tools

url rewriting with no extension in url

 
 
=?Utf-8?B?cmFwaWRkYXRh?=
Guest
Posts: n/a
 
      11-01-2006
//reposting because of spelling mistake in "rewritting" in original post

Is there a way to rewrite urls that have no extensions in the url, i.e. no
..aspx or no .html
like
http://www.mywebsite.com/username
to be rewritten as
http://www.mywebsite.com/pages/username.aspx

This is currently done in myspace.com where you can type
http://www.myspace.com/username

So far I have not found a solution to this problem.

When I go to IIS Management Console and try to do the
configuration extension mapping, it does not allow me to enter
..* or no extension for the mapping to the asp.net dll

Any help is greatly appreciated.

Thanks,
Leo
201-923-9595


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      11-01-2006
Unless you map the wildcard * to the ASP.NET ISAPI dll, which would make all
requests - even for images - go through ASP.NET and "hit" your urlrewriting
code, no.

You can use rewriting at the ISAPI level instead, if that's your goal. There
are several products out there, (ISAPI_REWRITE LITE is one that's free).
However, if you are in a shared hosting environment, it wouldn't help since
you'd need access to the desktop to install in IIS.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"rapiddata" wrote:

> //reposting because of spelling mistake in "rewritting" in original post
>
> Is there a way to rewrite urls that have no extensions in the url, i.e. no
> .aspx or no .html
> like
> http://www.mywebsite.com/username
> to be rewritten as
> http://www.mywebsite.com/pages/username.aspx
>
> This is currently done in myspace.com where you can type
> http://www.myspace.com/username
>
> So far I have not found a solution to this problem.
>
> When I go to IIS Management Console and try to do the
> configuration extension mapping, it does not allow me to enter
> .* or no extension for the mapping to the asp.net dll
>
> Any help is greatly appreciated.
>
> Thanks,
> Leo
> 201-923-9595
>
>

 
Reply With Quote
 
 
 
 
=?Utf-8?B?cmFwaWRkYXRh?=
Guest
Posts: n/a
 
      11-01-2006
Peter -

Thanks for you advice.
I will research ISAPI_REWRITE LITE

Also there was another suggestion by Gregory but I am in the process of
registering to Visual Studio Magazine to see the article refered to in the
link below:

Thanks for your help. I will give you more feedback soon.
Also can you please tell me your thoughts on Gregory's suggestion?

Thanks,
Leo
201-923-9595


By: Cowboy (Gregory A. Beamer) In:
microsoft.public.dotnet.framework.aspnet


http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com



"Peter Bromberg [C# MVP]" wrote:

> Unless you map the wildcard * to the ASP.NET ISAPI dll, which would make all
> requests - even for images - go through ASP.NET and "hit" your urlrewriting
> code, no.
>
> You can use rewriting at the ISAPI level instead, if that's your goal. There
> are several products out there, (ISAPI_REWRITE LITE is one that's free).
> However, if you are in a shared hosting environment, it wouldn't help since
> you'd need access to the desktop to install in IIS.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "rapiddata" wrote:
>
> > //reposting because of spelling mistake in "rewritting" in original post
> >
> > Is there a way to rewrite urls that have no extensions in the url, i.e. no
> > .aspx or no .html
> > like
> > http://www.mywebsite.com/username
> > to be rewritten as
> > http://www.mywebsite.com/pages/username.aspx
> >
> > This is currently done in myspace.com where you can type
> > http://www.myspace.com/username
> >
> > So far I have not found a solution to this problem.
> >
> > When I go to IIS Management Console and try to do the
> > configuration extension mapping, it does not allow me to enter
> > .* or no extension for the mapping to the asp.net dll
> >
> > Any help is greatly appreciated.
> >
> > Thanks,
> > Leo
> > 201-923-9595
> >
> >

 
Reply With Quote
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      11-01-2006
Could you point us to the post where "Gregory" made his suggestion? I do not
see anything is this thread.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"rapiddata" wrote:

> Peter -
>
> Thanks for you advice.
> I will research ISAPI_REWRITE LITE
>
> Also there was another suggestion by Gregory but I am in the process of
> registering to Visual Studio Magazine to see the article refered to in the
> link below:
>
> Thanks for your help. I will give you more feedback soon.
> Also can you please tell me your thoughts on Gregory's suggestion?
>
> Thanks,
> Leo
> 201-923-9595
>
>
> By: Cowboy (Gregory A. Beamer) In:
> microsoft.public.dotnet.framework.aspnet
>
>
> http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
>
>
>
> "Peter Bromberg [C# MVP]" wrote:
>
> > Unless you map the wildcard * to the ASP.NET ISAPI dll, which would make all
> > requests - even for images - go through ASP.NET and "hit" your urlrewriting
> > code, no.
> >
> > You can use rewriting at the ISAPI level instead, if that's your goal. There
> > are several products out there, (ISAPI_REWRITE LITE is one that's free).
> > However, if you are in a shared hosting environment, it wouldn't help since
> > you'd need access to the desktop to install in IIS.
> > Peter
> >
> > --
> > Co-founder, Eggheadcafe.com developer portal:
> > http://www.eggheadcafe.com
> > UnBlog:
> > http://petesbloggerama.blogspot.com
> >
> >
> >
> >
> > "rapiddata" wrote:
> >
> > > //reposting because of spelling mistake in "rewritting" in original post
> > >
> > > Is there a way to rewrite urls that have no extensions in the url, i.e. no
> > > .aspx or no .html
> > > like
> > > http://www.mywebsite.com/username
> > > to be rewritten as
> > > http://www.mywebsite.com/pages/username.aspx
> > >
> > > This is currently done in myspace.com where you can type
> > > http://www.myspace.com/username
> > >
> > > So far I have not found a solution to this problem.
> > >
> > > When I go to IIS Management Console and try to do the
> > > configuration extension mapping, it does not allow me to enter
> > > .* or no extension for the mapping to the asp.net dll
> > >
> > > Any help is greatly appreciated.
> > >
> > > Thanks,
> > > Leo
> > > 201-923-9595
> > >
> > >

 
Reply With Quote
 
Juan T. Llibre
Guest
Posts: n/a
 
      11-01-2006
From: "Cowboy \(Gregory A. Beamer\)" <(E-Mail Removed)>
References: <(E-Mail Removed)>
Subject: Re: url rewritting with no extension in url
Date: Tue, 31 Oct 2006 07:40:04 -0600

He suggested reviewing :

http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/



Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"Peter Bromberg [C# MVP]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Could you point us to the post where "Gregory" made his suggestion? I do not
> see anything is this thread.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "rapiddata" wrote:
>
>> Peter -
>>
>> Thanks for you advice.
>> I will research ISAPI_REWRITE LITE
>>
>> Also there was another suggestion by Gregory but I am in the process of
>> registering to Visual Studio Magazine to see the article refered to in the
>> link below:
>>
>> Thanks for your help. I will give you more feedback soon.
>> Also can you please tell me your thoughts on Gregory's suggestion?
>>
>> Thanks,
>> Leo
>> 201-923-9595
>>
>>
>> By: Cowboy (Gregory A. Beamer) In:
>> microsoft.public.dotnet.framework.aspnet
>>
>>
>> http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/
>>
>> --
>> Gregory A. Beamer
>> MVP; MCP: +I, SE, SD, DBA
>> http://gregorybeamer.spaces.live.com
>>
>>
>>
>> "Peter Bromberg [C# MVP]" wrote:
>>
>> > Unless you map the wildcard * to the ASP.NET ISAPI dll, which would make all
>> > requests - even for images - go through ASP.NET and "hit" your urlrewriting
>> > code, no.
>> >
>> > You can use rewriting at the ISAPI level instead, if that's your goal. There
>> > are several products out there, (ISAPI_REWRITE LITE is one that's free).
>> > However, if you are in a shared hosting environment, it wouldn't help since
>> > you'd need access to the desktop to install in IIS.
>> > Peter
>> >
>> > --
>> > Co-founder, Eggheadcafe.com developer portal:
>> > http://www.eggheadcafe.com
>> > UnBlog:
>> > http://petesbloggerama.blogspot.com
>> >
>> >
>> >
>> >
>> > "rapiddata" wrote:
>> >
>> > > //reposting because of spelling mistake in "rewritting" in original post
>> > >
>> > > Is there a way to rewrite urls that have no extensions in the url, i.e. no
>> > > .aspx or no .html
>> > > like
>> > > http://www.mywebsite.com/username
>> > > to be rewritten as
>> > > http://www.mywebsite.com/pages/username.aspx
>> > >
>> > > This is currently done in myspace.com where you can type
>> > > http://www.myspace.com/username
>> > >
>> > > So far I have not found a solution to this problem.
>> > >
>> > > When I go to IIS Management Console and try to do the
>> > > configuration extension mapping, it does not allow me to enter
>> > > .* or no extension for the mapping to the asp.net dll
>> > >
>> > > Any help is greatly appreciated.
>> > >
>> > > Thanks,
>> > > Leo
>> > > 201-923-9595
>> > >
>> > >



 
Reply With Quote
 
=?Utf-8?B?cmFwaWRkYXRh?=
Guest
Posts: n/a
 
      11-01-2006
Peter -

http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/

What do you think about this method?

Thanks,
Leo

"Peter Bromberg [C# MVP]" wrote:

> Could you point us to the post where "Gregory" made his suggestion? I do not
> see anything is this thread.
> Peter
>
> --
> Co-founder, Eggheadcafe.com developer portal:
> http://www.eggheadcafe.com
> UnBlog:
> http://petesbloggerama.blogspot.com
>
>
>
>
> "rapiddata" wrote:
>
> > Peter -
> >
> > Thanks for you advice.
> > I will research ISAPI_REWRITE LITE
> >
> > Also there was another suggestion by Gregory but I am in the process of
> > registering to Visual Studio Magazine to see the article refered to in the
> > link below:
> >
> > Thanks for your help. I will give you more feedback soon.
> > Also can you please tell me your thoughts on Gregory's suggestion?
> >
> > Thanks,
> > Leo
> > 201-923-9595
> >
> >
> > By: Cowboy (Gregory A. Beamer) In:
> > microsoft.public.dotnet.framework.aspnet
> >
> >
> > http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/
> >
> > --
> > Gregory A. Beamer
> > MVP; MCP: +I, SE, SD, DBA
> > http://gregorybeamer.spaces.live.com
> >
> >
> >
> > "Peter Bromberg [C# MVP]" wrote:
> >
> > > Unless you map the wildcard * to the ASP.NET ISAPI dll, which would make all
> > > requests - even for images - go through ASP.NET and "hit" your urlrewriting
> > > code, no.
> > >
> > > You can use rewriting at the ISAPI level instead, if that's your goal. There
> > > are several products out there, (ISAPI_REWRITE LITE is one that's free).
> > > However, if you are in a shared hosting environment, it wouldn't help since
> > > you'd need access to the desktop to install in IIS.
> > > Peter
> > >
> > > --
> > > Co-founder, Eggheadcafe.com developer portal:
> > > http://www.eggheadcafe.com
> > > UnBlog:
> > > http://petesbloggerama.blogspot.com
> > >
> > >
> > >
> > >
> > > "rapiddata" wrote:
> > >
> > > > //reposting because of spelling mistake in "rewritting" in original post
> > > >
> > > > Is there a way to rewrite urls that have no extensions in the url, i.e. no
> > > > .aspx or no .html
> > > > like
> > > > http://www.mywebsite.com/username
> > > > to be rewritten as
> > > > http://www.mywebsite.com/pages/username.aspx
> > > >
> > > > This is currently done in myspace.com where you can type
> > > > http://www.myspace.com/username
> > > >
> > > > So far I have not found a solution to this problem.
> > > >
> > > > When I go to IIS Management Console and try to do the
> > > > configuration extension mapping, it does not allow me to enter
> > > > .* or no extension for the mapping to the asp.net dll
> > > >
> > > > Any help is greatly appreciated.
> > > >
> > > > Thanks,
> > > > Leo
> > > > 201-923-9595
> > > >
> > > >

 
Reply With Quote
 
George Ter-Saakov
Guest
Posts: n/a
 
      11-01-2006
Without messing with ISAPIs you can not do that.

You can have a workaround by specifying your custom 404 page in IIS settings
and setting it to be (let say) 404.aspx
then you can do whatever you want.

The key is to transfer control to ASP.NET engine. Unfortunately the only way
to do it is to use aspx extensions in your requests.
But be ready that some pictures you forgot to upload on a server will be
triggering the same 404.aspx page.


George.



"rapiddata" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> //reposting because of spelling mistake in "rewritting" in original post
>
> Is there a way to rewrite urls that have no extensions in the url, i.e. no
> .aspx or no .html
> like
> http://www.mywebsite.com/username
> to be rewritten as
> http://www.mywebsite.com/pages/username.aspx
>
> This is currently done in myspace.com where you can type
> http://www.myspace.com/username
>
> So far I have not found a solution to this problem.
>
> When I go to IIS Management Console and try to do the
> configuration extension mapping, it does not allow me to enter
> .* or no extension for the mapping to the asp.net dll
>
> Any help is greatly appreciated.
>
> Thanks,
> Leo
> 201-923-9595
>
>



 
Reply With Quote
 
=?Utf-8?B?cmFwaWRkYXRh?=
Guest
Posts: n/a
 
      11-02-2006
What about this:

You can also get insanely clever with VirtualPathProvider. I'm
currently writing a blog engine with this (got to while away the hours
somehow) and it means I can do highly hackable URLS like:

/index
/index/2006
/index/2006/oct.rss
/posts/TitleOfPost
/posts/TitleOfPost.json
/posts/TitleOfPost/comments.rss(0,92)
/tag/SomeTag/
/tag/SomeTag/MicroSummary.atom

where the files referenced by those URLs don't exist, the
VirtualPathProvider can parse the URL and return an appropriate
VirtualFile.

In your case I think you could create VirtualPathProvider to do the
following:

is the URL in the pages directory?
no -> Pass it back to the default handler
yes ->
does the URL contain .aspx?
yes -> pass it back to the default handler
no -> pass url+".aspx" back to the default handler


There's a fairly relevant link here
[http://blogs.msdn.com/davidebb/archi...provider.aspx]


"George Ter-Saakov" wrote:

> Without messing with ISAPIs you can not do that.
>
> You can have a workaround by specifying your custom 404 page in IIS settings
> and setting it to be (let say) 404.aspx
> then you can do whatever you want.
>
> The key is to transfer control to ASP.NET engine. Unfortunately the only way
> to do it is to use aspx extensions in your requests.
> But be ready that some pictures you forgot to upload on a server will be
> triggering the same 404.aspx page.
>
>
> George.
>
>
>
> "rapiddata" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > //reposting because of spelling mistake in "rewritting" in original post
> >
> > Is there a way to rewrite urls that have no extensions in the url, i.e. no
> > .aspx or no .html
> > like
> > http://www.mywebsite.com/username
> > to be rewritten as
> > http://www.mywebsite.com/pages/username.aspx
> >
> > This is currently done in myspace.com where you can type
> > http://www.myspace.com/username
> >
> > So far I have not found a solution to this problem.
> >
> > When I go to IIS Management Console and try to do the
> > configuration extension mapping, it does not allow me to enter
> > .* or no extension for the mapping to the asp.net dll
> >
> > Any help is greatly appreciated.
> >
> > Thanks,
> > Leo
> > 201-923-9595
> >
> >

>
>
>

 
Reply With Quote
 
Flinky Wisty Pomm
Guest
Posts: n/a
 
      11-02-2006
You probably *could* use a VPP, but I think it's overkill. It has its
own set of drawbacks (no precompilation for one). I'm mostly using it
because - damn it - it's hella cool, and I want to use it as a test-bed
for creating RESTful json web services at some point in the future.

-- flink

rapiddata wrote:

> What about this:
>
> You can also get insanely clever with VirtualPathProvider. I'm
> currently writing a blog engine with this (got to while away the hours
> somehow) and it means I can do highly hackable URLS like:
>
> /index
> /index/2006
> /index/2006/oct.rss
> /posts/TitleOfPost
> /posts/TitleOfPost.json
> /posts/TitleOfPost/comments.rss(0,92)
> /tag/SomeTag/
> /tag/SomeTag/MicroSummary.atom
>
> where the files referenced by those URLs don't exist, the
> VirtualPathProvider can parse the URL and return an appropriate
> VirtualFile.
>
> In your case I think you could create VirtualPathProvider to do the
> following:
>
> is the URL in the pages directory?
> no -> Pass it back to the default handler
> yes ->
> does the URL contain .aspx?
> yes -> pass it back to the default handler
> no -> pass url+".aspx" back to the default handler
>
>
> There's a fairly relevant link here
> [http://blogs.msdn.com/davidebb/archi...provider.aspx]
>
>
> "George Ter-Saakov" wrote:
>
> > Without messing with ISAPIs you can not do that.
> >
> > You can have a workaround by specifying your custom 404 page in IIS settings
> > and setting it to be (let say) 404.aspx
> > then you can do whatever you want.
> >
> > The key is to transfer control to ASP.NET engine. Unfortunately the only way
> > to do it is to use aspx extensions in your requests.
> > But be ready that some pictures you forgot to upload on a server will be
> > triggering the same 404.aspx page.
> >
> >
> > George.
> >
> >
> >
> > "rapiddata" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > //reposting because of spelling mistake in "rewritting" in original post
> > >
> > > Is there a way to rewrite urls that have no extensions in the url, i.e. no
> > > .aspx or no .html
> > > like
> > > http://www.mywebsite.com/username
> > > to be rewritten as
> > > http://www.mywebsite.com/pages/username.aspx
> > >
> > > This is currently done in myspace.com where you can type
> > > http://www.myspace.com/username
> > >
> > > So far I have not found a solution to this problem.
> > >
> > > When I go to IIS Management Console and try to do the
> > > configuration extension mapping, it does not allow me to enter
> > > .* or no extension for the mapping to the asp.net dll
> > >
> > > Any help is greatly appreciated.
> > >
> > > Thanks,
> > > Leo
> > > 201-923-9595
> > >
> > >

> >
> >
> >


 
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
URL rewriting on the Cisco Content Switch CSS 11503 j208@gmx.net Cisco 1 10-02-2005 06:35 PM
url rewriting when the url contains parameters Gaurav Agarwal Java 2 01-31-2005 11:15 AM
URL rewriting with SCA -=_ Antani _=- Cisco 0 09-16-2004 08:45 AM
httpmodules and url rewriting with no extension Thedotnetteer ASP .Net 2 11-27-2003 09:49 PM
URL rewriting Juha Borenius ASP .Net 2 08-15-2003 01:40 PM



Advertisments