473,406 Members | 2,707 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,406 software developers and data experts.

url rewritting with no extension in url

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

Oct 31 '06 #1
3 1221
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" <ra*******@discussions.microsoft.comwrote in message
news:B5**********************************@microsof t.com...
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

Oct 31 '06 #2
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" <ra*******@discussions.microsoft.comwrote in message
news:B5**********************************@microsof t.com...
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
Oct 31 '06 #3
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" <ra*******@discussions.microsoft.comwrote in message
news:B5**********************************@microsof t.com...
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


Oct 31 '06 #4

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

Similar topics

6
by: Gyger | last post by:
Hello, Three weeks ago, I have started to develop a binding extension for Qt and PHP 5. Now, I can display a dialog box containing some widgets like label, buttons and edit line. I have just...
8
by: Torsten Mohr | last post by:
Hi, i write an extension module in C at the moment. This module does some work on some own data types that consist of some values. The functions that can change the data are written in C. ...
3
by: man-in-nature | last post by:
Hello, I have already read several existing posts about xsd:extension, but do not find something useful to my test case. I have one xml file and one xsd file. I can use a simple command line...
5
by: Jeffry van de Vuurst | last post by:
Hi, I'm working on an xml schema and I'm running into some problems relating substitutionGroups and extensions. This xsd validates fine: There are three elements and three complex types and...
7
by: Adam | last post by:
Im trying to add an httphandler for all *.sgf file extensions. I have developed the handler, 1. installed it into the gac 2. added it to the machine.config: <httpHandlers> <add verb="*"...
1
by: Brian Henry | last post by:
Just thought maybe someone here would like to know this. It's an example code I just created quickly on how to figure out the name of a type of file based on its extension (say for example .DOC)...
0
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService"...
6
by: tommybiegs | last post by:
I'm having a weird problem. I can't seem to force php to load an extension using php.ini, but it loads perfectly if I use dl() at the beginning of a test script. In php.ini I've got: ...
1
Ganesh9u
by: Ganesh9u | last post by:
Hi All, import org.sf.feeling.swt.win32.extension.hook.Hook; import org.sf.feeling.swt.win32.extension.hook.data.HookData; import org.sf.feeling.swt.win32.extension.hook.data.MouseHookData; ...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.