473,656 Members | 2,871 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vanity URLs

I know how to create vanity urls for users when they append a .aspx
to their name, but is it possible to pick up their name alone
(without affixing .aspx?)

e.g.
in the global.asax file I can map the following url:

www.mysite.com/someuser.aspx

to www.mysite.com/users.aspx?userid=someuser

by using a Path.GetFileNam eWithoutExtensi on( Request.Path )
in the Application_Beg inRequest subroutine.

But is it possible to do the same thing if I entered:

www.mysite.com/someuser

All I get is a "Page not found" error... is there a way to catch
it before it returns this error, and redirect to the users.aspx
file?

Cheers!
--

"I hear ma train a comin'
.... hear freedom comin"
Nov 18 '05 #1
1 1368
You are after what is called URL rewriting

Check out tip 7
http://www.dnzone.com/showDetail.asp...d=2&NewsId=110

Also look at System.Web.IHTT PHandler

Sorry not too familiar with how to do it on IIS.

JB
"Stimp" <re*@spumco.com > wrote in message
news:sl******** ********@carbon .redbrick.dcu.i e...
I know how to create vanity urls for users when they append a .aspx
to their name, but is it possible to pick up their name alone
(without affixing .aspx?)

e.g.
in the global.asax file I can map the following url:

www.mysite.com/someuser.aspx

to www.mysite.com/users.aspx?userid=someuser

by using a Path.GetFileNam eWithoutExtensi on( Request.Path )
in the Application_Beg inRequest subroutine.

But is it possible to do the same thing if I entered:

www.mysite.com/someuser

All I get is a "Page not found" error... is there a way to catch
it before it returns this error, and redirect to the users.aspx
file?

Cheers!
--

"I hear ma train a comin'
... hear freedom comin"

Nov 18 '05 #2

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

Similar topics

1
3419
by: phpkid | last post by:
Howdy I've been given conflicting answers about search engines picking up urls like: http://mysite.com/index.php?var1=1&var2=2&var3=3 Do search engines pick up these urls? I've been considering converting a site of mine to PHP-Nuke, but if the individual modules aren't picked up in search engines I'm not going to do it. Thanks phpKid
26
12494
by: Howard Brazee | last post by:
I would like to click on a URL of a html document that will open several URLs at once for me. Does someone have an example of a html document that will do this?
1
1813
by: DM | last post by:
I'm working on a site with more than 1700 HTML files. We'll be moving files around on this site a lot because we're reorganizing it. I'm thinking of writing a script that will convert all URLs in href and src attributes to absolute URLs with this form: href="/somedir/somefile.htm" src="/images/somecategory/image.gif" That way, if you move a page from one directory to another, the links and image references within the page will not...
2
2606
by: Showjumper | last post by:
How would i go about making vanity urls such that its really the same url for everyone but that it just appears different based on who logs in.
2
2048
by: Eric Lemmon | last post by:
Greetings, I wrote code to handle vanity URLs, so--for example--the URL http://localhost/myApp/bsmith.aspx is internally translated to http://localhost/myApp/Support/UserPage.aspx?user=bsmith. The problem is that whenever I access the vanity URL, http://localhost/myApp/bsmith.aspx, the page shows without any CSS styles...quite ugly. However, when I get to the page directly using its actual address,...
3
1815
by: Leon | last post by:
How to personalized different parts of my website using vanity sub-domain name url. example: my domain name is www.mydomain.com. I would like the vanity url to be myname.mydomain.com, and personalize the current page from the database using that vanity url ('myname.mydomain.com').
10
4908
by: jflash | last post by:
Hello all, I feel dumb having to ask this question in the first place, but I just can not figure it out. I am wanting to set my site up using dynamic urls (I'm assuming that's what they're called, an example of what I have in mind is index.php?page=). However, I can not figure out how to do this. I will eventually want to use SEF urls, but for now I'll be content just to have the dynamic urls. If anyone can tell me how to do this, I'd...
9
5092
by: Salve =?iso-8859-1?Q?H=E5kedal?= | last post by:
What is the best regular expression for finding urls in plain text files? (By urls I mean http://www.something.com, but also www.something.com, or salve@somewhere.com) Salve
3
3865
by: WebCM | last post by:
How to apply nice URL-s into CMS? 1. Should we use nice urls for every page? 2. Do we need to put a FULL path into <a href="">? 3. What is faster and better? a) 10 rules in .htaccess which redirect you to normal URLs with GET parameters
0
8816
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8717
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7311
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6162
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5629
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1930
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1600
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.