[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 594
  • Last Modified:

ASP vbScript GET variable from URL directory

I don't even know where to start to give sample code, but basically I'm wondering if there's a way in asp, vbscript to have it when:

www.mysite.com/users/username is entered

the default file in the users directory can somehow request the last bit like

username = Replace(Request.ServerVariables("URL"),"/users/","")

Thanks

0
AlaskaGuide
Asked:
AlaskaGuide
1 Solution
 
devlab2012Commented:
Do you mean to say that user will request a page with url like the following:
www.mysite.com/users/devlab2012

and the request will be actually processed by a file:
index.asp in the directory named "users". i.e. actual path will be:
www.mysite.com/users/index.asp
And the index.asp file will find the user name and process the request accordingly.

If this is the case, then you are talking about URL Rewriting, URL Redirection. Although not directly possible in classic ASP, but following blog post will give you some directions:
http://asp.johnavis.com/blog/default.asp?id=19

There is a simple IIS tool from Microsoft to control url rewriting at IIS level. It is "URL Rewrite 2.0". You can get more details at:
http://www.iis.net/download/urlrewrite
0
 
AlaskaGuideAuthor Commented:
Perfect!

I was thinking it would take some IIS work. Thanks I also needed to upgrade to IIS from 6 to 7.

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=32c54c37-7530-4fc0-bd20-177a3e5330b7 
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now