473,378 Members | 1,426 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

url rewriting with no extension in url

//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
Nov 1 '06 #1
8 2360
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

Nov 1 '06 #2
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
Nov 1 '06 #3
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
>
>
Nov 1 '06 #4
From: "Cowboy \(Gregory A. Beamer\)" <No************@comcast.netNoSpamM>
References: <B5**********************************@microsoft.co m>
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]" <pb*******@yahoo.nospammin.comwrote in message
news:9D**********************************@microsof t.com...
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


Nov 1 '06 #5
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
Nov 1 '06 #6
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" <ra*******@discussions.microsoft.comwrote in message
news:6B**********************************@microsof t.com...
//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


Nov 1 '06 #7
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" <ra*******@discussions.microsoft.comwrote in message
news:6B**********************************@microsof t.com...
//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


Nov 2 '06 #8
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" <ra*******@discussions.microsoft.comwrote in message
news:6B**********************************@microsof t.com...
//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
>
>
Nov 2 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Thedotnetteer | last post by:
hi. I wrote a very simple httpmodule to transform calls as www.mysite.com/users/john to www.mysite.com/userspage.aspx?id=john the problem is that my module is called only when the called page...
9
by: Alan Silver | last post by:
Hello, I would like to be able to use an URL like ... http://www.whatever.com/order/123 and have it translated into ... http://www.whatever.com/orders.aspx?orderid=123
3
by: DC | last post by:
Hi, I need something that rewrites a URL like myserver.com/parm1/val1/parm2/val2 to myserver.com/default.aspx?parm1=val1&parm2=val2
0
by: kellygreer1 | last post by:
Anyone else getting errors when using the URL Rewriting solution mentioned at the bottom of this article: http://www.codeproject.com/aspnet/urlrewriter.asp?df=100&forumid=4228&exp=0&select=876107 ...
3
by: Greg Collins [Microsoft MVP] | last post by:
I have done a bit of research of Url Rewriting, but as yet have been unsuccessful at getting it to work well, and there are issues around what file types are supported and how much code you want to...
1
by: craigkenisston | last post by:
According to this guys here: http://tinyurl.com/ygjxry "You can use different URL styles: * http://www.myweb.com/products/nokia * http://www.myweb.com/products/nokia.aspx *...
8
by: Christina | last post by:
Hiya!! I am trying to do something really simple here.. I have a link, clicking on which leads to a page say MyPage.aspx. There's a query string also passed to it. Hence its : ...
2
by: Moistly | last post by:
Has ever tried to do URL rewriting in ASP.NET 2.0 ie I have no trouble on my own machine but it just doesn't seem to work dev server Basically I am trying to map something like ...
1
Shinobi
by: Shinobi | last post by:
I am using ASP.net(c#) for my project. In my my project 2 pages are using URL rewriting method by referring this article URL Rewriting using Intelligencia UrlRewriter Example 1 - Blog Day...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.