Link to home
Start Free TrialLog in
Avatar of nfmesa
nfmesa

asked on

Personalized URL

I want to beable to give out a url such as http://www.mydomain.com/johndoe instead of doing something like http://www.mydomain.com/user.asp?user=johndoe.

What would be my best option to pull the url and post my own information.
Avatar of nfmesa
nfmesa

ASKER

Note I would rather not do it through custome 404 error page.
I answered a question last week similar to this - https://www.experts-exchange.com/questions/21713201/How-do-I-control-what-appears-in-the-browser-Address-field.html

That should answer things for you.

- Anthony
You could use a third party ISAPI filter to do a url rewrite or just put a default asp page in the johndoe directory to redirect to  http://www.mydomain.com/user.asp?user=johndoe.  Using server.transfer or server.execute would be less bandwidth but can mess things up when you switch directories.
Avatar of nfmesa

ASKER

Alariva
I dont have a problem with the domain, I actually own the domain, and I own the 7 servers that host different sites that I would want to impliment them with. servers running 2k/2k3.

JoePoster649
Dont want it to do a redirect either though. I want it to stay on the one location and just display a page with the users information without having seperate directories for each user.
Can you explain this? "What would be my best option to pull the url and post my own information."
Avatar of nfmesa

ASKER

Sorry I wasnt clear. I was wondering what would be the best option to pull the string that they entered Request.ServerVariable("SCRIPT_NAME") to get the name of the location and pull the name of what they are trying to hit for the username.
I can see I should have been more clear myself.

This is a virtual path and actually pointing to a folder, not a file.

http://www.mydomain.com/johndoe

It should be written as: http://www.mydomain.com/johndoe/

If you browse to this and it loads a page, that means it loaded a default page.  There can be more than one.

Ex. default.asp, default.aspx, default.html, index.asp, index.aspx, index.html

The web server will search them in the order they are in the list and if found will return that file.  If none of them are found, the 404 Error page will be returned. Returned means display in the user's browser.

You are being too general in your statements.

"pull the string that they entered" Pull?  Who is they?

Request.ServerVariables("SCRIPT_NAME") returns the relative path to the page it runs in.
Ex. http://www.mydomain.com/johndoe/

If actually returning the default page: default.asp would return: /johndoe/Default.asp.
http://devguru.com/technologies/asp/9143.asp

Please explain what happens, step-by-step and what you want to happen.
Avatar of nfmesa

ASKER

Nothing happens, I just want it to return johndoe as the user name so i can do a search through the querystring and pull the data. I am really wanting basicly no matter what they tipe in the root of the appltion to pull the default page and return the directory there after (johndoe) as something similar to a querystring.

I want http://www.domain.com/default.asp?user=johndoe

to be used as http://www.domain.com/johndoe

and in theory beable to do a request.querystring("user") and it return johndoe. I was really giving an example of what I wanted not that I was thinking of using script_name just thinking it through with you guys...
dim u
u = Server.HTMLEncode(Request.QueryString("user"))
if u <> "" then Server.Transfer "/" & u
Avatar of nfmesa

ASKER

Ok but its not a querystring if you type in http://www.domain.com/johndoe user.

I want to be able to use http://www.domain.com/johndoe

johndoe being the user name, I do not want to create 1000 of directories for each user.

I do not want to use 404 error messages if I do not have to (looks like I am going to have to)

I do not want to have them type in http://www.domain.com/default.asp?id=johndoe
I want them ONLY to have to type http://www.domain.com/johndoe nothing more. If I do a Request.QueryString("user") regardless of Server.HTMLEncode("") that just converts & over to (&amp;).

Thank you. I guess I really need to right better questions off in the beginning that make more sense or something.
Create a virtual directory in IIS called johndoe and make sure the defult document is default.asp.  You can automate this down the road using asdi.
Then either instead of having default.asp take in a querystring called id have it parse johndoe out of a server variable (URL,SCRIPT_NAME,PATH_INFO or APPL_MD_PATH).
If you really want it in the querystring use a different default page to do the parsing and redirect to default.asp?id=johndoe
Avatar of nfmesa

ASKER

Well if I have to do that times 1000+ people i would rather use the 404 error.
Spelling corrections...
defult should be default
and
asdi should be adsi
ASKER CERTIFIED SOLUTION
Avatar of joeposter649
joeposter649

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of nfmesa

ASKER

Oh I am sorry, I miss understood your answer... I thought you were saying I would have to create all different virtual directories.
Thank you joe