Velocity Reviews - Computer Hardware Reviews

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

Reply
Thread Tools

url rewritting with no extension in url

 
 
=?Utf-8?B?cmFwaWRkYXRh?=
Guest
Posts: n/a
 
      10-31-2006
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
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      10-31-2006
http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/

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

*************************************************
Think outside of the box!
*************************************************
"rapiddata" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
 
      10-31-2006
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]

Let me know how you get on if you go down the VPP route, 'cos I'm
curious.

Cowboy (Gregory A. Beamer) wrote:

> http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
>
> *************************************************
> Think outside of the box!
> *************************************************
> "rapiddata" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
 
      10-31-2006
Gregory -

Thanks for the advice but I can not read the other pages in the article past
page 1 because the article is from 2002 and I have a 2006 subscription to
msdn magazine.

Can you please provide the code?

Thanks,
Leo
201-923-9595

"Cowboy (Gregory A. Beamer)" wrote:

> http://www.fawcette.com/vsm/2002_02/...ne/columns/qa/
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
> http://gregorybeamer.spaces.live.com
>
> *************************************************
> Think outside of the box!
> *************************************************
> "rapiddata" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
rewritting the standards Paul C++ 0 02-26-2011 11:50 AM
Net 3.5 SP1 pb with ajax.net and themes + url rewritting WT ASP .Net 8 12-08-2008 02:25 AM
url rewriting with no extension in url =?Utf-8?B?cmFwaWRkYXRh?= ASP .Net 8 11-02-2006 01:48 PM
New extension? saw extension .emf is it safe to open Jer Computer Support 5 10-08-2005 04:43 PM
Re: help on rewritting c++ for Mac into MSDOS - "IsNan.c" 5832 Bytes Christopher Benson-Manica C++ 0 05-11-2004 01:19 PM



Advertisments