Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3

Thread: URL Extensions?

  1. #1
    New to the CF scene
    Join Date
    Jun 2005
    Location
    wwwroot
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question URL Extensions?

    Hello all,

    I am writing an ASP/database driven site and I need to be able to have subdomains in my code based on certain member information. For instance if my membership name for the site is "James" then I would need the URL as follows:

    www.mywebsite.com/James

    And I would need the above URL to point to an asp page...

    Does anyone know how I can accomplish this?

    Thanks in advance,

    Xman51
    Xman51
    Area 51

  • #2
    Senior Coder TheShaner's Avatar
    Join Date
    Sep 2005
    Location
    Orlando, FL
    Posts
    1,126
    Thanks
    2
    Thanked 40 Times in 40 Posts
    Well, if you have an html page that asks for a member name with an input named MemberName and submits to the below ASP page (MemberRedirect.asp), you could do something like:

    Code:
    <%  ' MemberRedirect.asp %>
    <%@ Language = "VBScript" %>
    <%
      Reponse.Buffer = True
      
      Dim member, redirectPage
      ' Grabs the member's name from previous page and trims any leading or trailing white space
      member = Trim(Request.Form("MemberName"))
      'Redirect to member's subdomain
      redirectPage = "www.mywebsite.com/" & MemberName & ".asp"
      Response.Redirect(redirectPage)
    
    %>
    -Shane

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    478
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Technically that's not considered a subdomain, but this is:
    http://james.mywebsite.com

    And actually www.mywebsite.com/James DOES already point to a page and that page is this:

    http://www.mywebsite.com/james/default.asp

    And several Web hosts such as Gearhost.com and Best-Machine.com allow one to set up multiple Web sites on one account. Thus you could have:

    http://www.mysite.com

    And you could make it so that http://www.myothersite.com points to the http://www.mysite.com/myothersite folder.
    J. Paul Schmidt
    www.Bullschmidt.com - Freelance Web and Database Developer
    www.Bullschmidt.com/DevTip.asp - Classic ASP Design Tips


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •