Connecting Tech Pros Worldwide Forums | Help | Site Map

url rewriting with no extension in url

rapiddata
Guest
 
Posts: n/a
#1: Nov 1 '06
//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



Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
#2: Nov 1 '06

re: url rewriting with no extension in url


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:
Quote:
//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
>
>
rapiddata
Guest
 
Posts: n/a
#3: Nov 1 '06

re: url rewriting with no extension in url


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:
Quote:
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:
>
Quote:
//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
Peter Bromberg [C# MVP]
Guest
 
Posts: n/a
#4: Nov 1 '06

re: url rewriting with no extension in url


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:
Quote:
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:
>
Quote:
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:
Quote:
//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
>
>
Juan T. Llibre
Guest
 
Posts: n/a
#5: Nov 1 '06

re: url rewriting with no extension in url


From: "Cowboy \(Gregory A. Beamer\)" <NoSpamMgbworld@comcast.netNoSpamM>
References: <B50E7B0A-CF51-40A4-B5BF-519498C9EAE0@microsoft.com>
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]" <pbromberg@yahoo.nospammin.comwrote in message
news:9D628FAB-ED9E-4E86-B11C-7F69FB6E946C@microsoft.com...
Quote:
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:
>
Quote:
>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:
>>
Quote:
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
>
>

rapiddata
Guest
 
Posts: n/a
#6: Nov 1 '06

re: url rewriting with no extension in url


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:
Quote:
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:
>
Quote:
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:
Quote:
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
George Ter-Saakov
Guest
 
Posts: n/a
#7: Nov 1 '06

re: url rewriting with no extension in url


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" <rapiddata@discussions.microsoft.comwrote in message
news:6B0D5A81-DFEC-4D34-8770-AABD00E1B8E8@microsoft.com...
Quote:
//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
>
>

rapiddata
Guest
 
Posts: n/a
#8: Nov 2 '06

re: url rewriting with no extension in url


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:
Quote:
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" <rapiddata@discussions.microsoft.comwrote in message
news:6B0D5A81-DFEC-4D34-8770-AABD00E1B8E8@microsoft.com...
Quote:
//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
>
>
>
Flinky Wisty Pomm
Guest
 
Posts: n/a
#9: Nov 2 '06

re: url rewriting with no extension in url


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:
Quote:
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:
>
Quote:
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" <rapiddata@discussions.microsoft.comwrote in message
news:6B0D5A81-DFEC-4D34-8770-AABD00E1B8E8@microsoft.com...
Quote:
//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
>
>
Closed Thread