Professional Web Applications Themes

Dynamic Directories - Coldfusion - Advanced Techniques

I am in need of some direction. I don't even know what the proper name of this is. I need to create a url visible directory structure so that when a customer signs up for my site, they will get an easy url to direct friends to. Eg. If my user name is hotdogwild the url should look like this http://www.mysite.com/hotdogwild When the page is pulled up, I will need to be able to know what dynamic content page to show. I don't really want to have multiple sub directories in the docroot. My client believes that they will have ...

  1. #1

    Default Dynamic Directories

    I am in need of some direction. I don't even know what the proper name of this
    is. I need to create a url visible directory structure so that when a customer
    signs up for my site, they will get an easy url to direct friends to. Eg. If
    my user name is hotdogwild the url should look like this

    http://www.mysite.com/hotdogwild

    When the page is pulled up, I will need to be able to know what dynamic
    content page to show. I don't really want to have multiple sub directories in
    the docroot. My client believes that they will have 10s of thousands of
    customers needing this type of url within the first year or two, definately a
    couple thousand within a month or two.

    Does anyone know of some online or non-online resources that discuss how to
    implement this? It would be greatly appreciated.

    William

    coderWil Guest

  2. #2

    Default Re: Dynamic Directories

    One technique is a little goofy, but works really well. To do this, you need
    to be able to control your site wide error page on the server.

    One way to do it:
    In the error control page, if it's a 404, check to see if the url has a file
    extension. If not, take the last part [ listlast(url,"/") ] and do a query
    against your db, where you should have the client directory name and other
    useful information stored.

    If your query returns a record, send them to wherever. No result, give them
    an error page.

    The drawback is you lose the url in the address bar.

    Good luck!


    Chiller Guest

  3. #3

    Default Re: Dynamic Directories

    coderWil wrote: 

    If you're using Apache as a webserver you could use mod_rewrite or
    mod_alias. For IIS I think isapirewrite is the one:
    http://www.isapirewrite.com/

    --
    <mack />


    Neculai Guest

  4. #4

    Default Re: Dynamic Directories

    Thank you very much, I investigated both and the fastest solution is the dynamic error page, when I have time I will furhter investigate mod_rewrite and all of its glory :)
    coderWil Guest

Similar Threads

  1. reading directories
    By Jeff in forum UNIX Programming
    Replies: 21
    Last Post: December 19th, 10:23 AM
  2. ...and deleting directories?
    By Kurt Euler in forum Ruby
    Replies: 3
    Last Post: October 8th, 07:33 PM
  3. Can't Make Directories Now
    By Seth Willits in forum PHP Development
    Replies: 0
    Last Post: September 1st, 10:02 PM
  4. Replies: 2
    Last Post: July 30th, 07:00 PM
  5. Traverse directories
    By Keith Maika in forum PHP Development
    Replies: 2
    Last Post: July 29th, 10:10 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139