473,395 Members | 1,629 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,395 software developers and data experts.

Shortened URL

I have an application and I'd like to shorten the url for some of the pages.
Instead of:
www.domain.com/page.aspx?key=12345

I'd like it to be like this:

www.domain.com/12345

Obviously this brings into this equation 2 issues.

#1. is the document being served. I believe it will automatically submit
the data to the default page (default.aspx in this case), so I just need to
rename the script to that. Am I right?

#2. is the variable. Since I'm no longer supplying the key, the application
will need to figure it out on its own. How best to handle this part?

Jul 21 '05 #1
4 1400
Shabam,

Can you explain this what more,
www.domain.com/page.aspx?key=12345 means that you have a "page.aspx" which Gets the "key" and does something
with the value in that
www.domain.com/12345

means that you have a page 12345 with a default extention which has to be
processed

Or do I see something wrong?

Cor
Jul 21 '05 #2
You can do this with HTTP handlers.

You may want to shorten your url to www.domain.com/12345.xyz where .xyz is
whatever extension you want to use.

See the following articles:
http://support.microsoft.com/default...b;EN-US;308001
http://msdn.microsoft.com/library/de...tphandlers.asp

You can also google on "ASP.NET HTTP Handler" and get dozens more hits.

Hope this helps.
--- Nick

"Shabam" <bl******@hotmail.com> wrote in message
news:co********************@adelphia.com...
I have an application and I'd like to shorten the url for some of the pages. Instead of:
www.domain.com/page.aspx?key=12345

I'd like it to be like this:

www.domain.com/12345

Obviously this brings into this equation 2 issues.

#1. is the document being served. I believe it will automatically submit
the data to the default page (default.aspx in this case), so I just need to rename the script to that. Am I right?
no. That will not work. IIS will try to find a resource called "12345" in
your web site, and will fail when it doesn't find it.

#2. is the variable. Since I'm no longer supplying the key, the application will need to figure it out on its own. How best to handle this part?
HTTP Handler... see above

Jul 21 '05 #3
Shabam wrote:
I have an application and I'd like to shorten the url for some of the
pages. Instead of:
www.domain.com/page.aspx?key=12345

I'd like it to be like this:

www.domain.com/12345

Obviously this brings into this equation 2 issues.

#1. is the document being served. I believe it will automatically
submit the data to the default page (default.aspx in this case), so I
just need to rename the script to that. Am I right?

#2. is the variable. Since I'm no longer supplying the key, the
application will need to figure it out on its own. How best to
handle this part?


This article on MSDN should get you started:
http://msdn.microsoft.com/library/de...lrewriting.asp

Cheers,

--
Joerg Jooss
jo*********@gmx.net
Jul 21 '05 #4
> This article on MSDN should get you started:

http://msdn.microsoft.com/library/de...lrewriting.asp

Thanks for the info. Can't believe I didn't think of that. I've been
dealing in Apache and have used mod_rewrite to do such things in the past.
However with IIS I'm at a loss.

Could someone give me sample code that would do what I just mentioned?

Basically I need to turn:
www.domain.com/page.aspx?key=12345

into:

www.domain.com/12345
Jul 21 '05 #5

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

Similar topics

13
by: lucanos | last post by:
Hey All, Just wondering whether there is an abbreviated "If - Then - Else" format in PHP, much like that possible in JavaScript. JavaScript allows an abbreviated version in the following...
1
by: Ant | last post by:
I installed the software and activated the 60 day free trail period for Visual Studio .NET yesterday. After completing the registration process for the product, yesterday, I received a popup...
10
by: JMorrell | last post by:
First post to this community so am not sure if this is the correct place. Here goes. I have a MS Access db that keeps track of employees sick and annual leave balances. In it, I have a report,...
3
by: Anders Borum | last post by:
Hello Jon, et all. I am working on a framework with context bound objects (models). The objects expose common functionality, such as the ability to get a serialized Xml representation of an...
4
by: Shabam | last post by:
I have an application and I'd like to shorten the url for some of the pages. Instead of: www.domain.com/page.aspx?key=12345 I'd like it to be like this: www.domain.com/12345 Obviously this...
2
by: pede69 | last post by:
Hi... Would someone please be kind enough to help me with php code to insert into my webpage? I have a site that shortens a url. It uses an SQL DB. (not important for this, I believe) I need...
3
by: r.e.s. | last post by:
Can the following program be shortened? ... def h(n,m): E=n, while (E!=())*m>0:n=h(n+1,m-1);E=E+(E>0)*(E-1,)*n return n h(9,9) Note: Although it halts eventually in principle, this program...
3
by: Joseph | last post by:
I have an expression which is used in a form to change a text box to either read "Action" or "No Action", based on the state of a series of 12 check boxes and three text boxes. I want to use the...
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.