Solved

ASP vbScript GET variable from URL directory

Posted on 2011-02-25
2
589 Views
Last Modified: 2012-06-21
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
Comment
Question by:AlaskaGuide
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
devlab2012 earned 347 total points
ID: 34987066
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
 

Author Comment

by:AlaskaGuide
ID: 34987470
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question