Forum Moderators: open

Message Too Old, No Replies

http://www.example.com/dynamicvalue

without using URL rewrite?

         

mattglet

10:53 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i have a user based site, where you would normally access your site via this method: h*tp://www.example.com/default.asp?id=mattglet

i now need to try to change it so people can access their site via this method: h*tp://www.example.com/mattglet

creating folders or virtual directories for each user is not an option. i need it to redirect the example.com/mattglet to default.asp?id=mattglet *nix users are able to do this effectively by using the .htaccess file, and creating a rewrite. i am using ASP, and cannot install a rewriter on the server. is there any code that will be able to do what i need?

let me know if you need more information.

-Matt

bakedjake

10:54 pm on Jan 23, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Well, if you:

  • Can't install software
  • And can't redirect via the IIS manager

    There's not much you can do. Sorry.

    Added: See below. plumsauce's suggestion is golden.

    [edited by: bakedjake at 12:09 am (utc) on Jan. 24, 2004]

  • plumsauce

    11:11 pm on Jan 23, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member




    Matt,

    Set default.asp as the default 404 handler for
    the root directory only, using URL and not FILE
    as the type. See the management console for this.

    When the server sees:

    h*tp://www.example.com/mattglet

    it will execute:

    default.asp?404;h*tp://www.example.com/mattglet

    parse the query variable in default.asp using a
    regular expression to extract the mattglet part
    and carry on.

    This is just a variation on custom error pages.

    Hint, to get this going during development,
    just do a Response.Write of the data so that
    you can see what is happening.

    using dns wildcards and this method, you can
    even do h*tp://mattglet.example.com if you
    wanted to.

    +++

    bakedjake

    11:13 pm on Jan 23, 2004 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



    Set default.asp as the default 404 handler for the root directory only, using URL and not FILE as the type.

    plumsauce, I love ya man, but don't do this Matt. You'll kill your search engine visibility if you go and start returning 404s on every page.

    mattglet

    11:18 pm on Jan 23, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    jake-
    i don't need search engine visibility on this site.

    plumsauce, i will research your solution and see what happens.

    thanks to both of you.

    -Matt

    bakedjake

    11:23 pm on Jan 23, 2004 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



    i don't need search engine visibility on this site.

    okay. also, you may want to keep in mind that it could break if a user has IE's "friendly error messages" enabled. but you'll have to test that - sometimes it works, sometimes it doesn't.

    mattglet

    11:33 pm on Jan 23, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    ah, good call. definitely will pay attention to that.

    -Matt

    plumsauce

    11:49 pm on Jan 23, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member




    Jake,

    I understand what you are saying.

    However, this is an *internal* error handler.
    The client, whether browser or robot, never
    sees anything but 200 *and* the desired
    content.

    All you are doing is substituting reading
    one query variable for another in default.asp.

    I guarantee you($.02) that the client will not
    know the difference if this is done correctly.

    During development I normally use a development
    server and a sniffer to see exactly what the
    client will see including all headers.

    So, I understand that at first blush that there
    are some concerns, but it does work and accomplishes
    exactly what Matt wants.

    And the $64.00 question, have I done this?

    Yes, all the time.

    mattglet

    12:07 am on Jan 24, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    a friend of mine (and another regular on this forum) has also implemented this. i have seen it in action, and i will agree that it works. it wasn't until now that i realized that this solution is what i'm looking for. he used it as a simple URL rewrite with ASP. and the same technique can be used in my situation. we looked at the header responses with searchengineworld.com's spider sim (or whatever it's called) that displays the server headers, and it comes up 200 everytime.

    -Matt

    bakedjake

    12:08 am on Jan 24, 2004 (gmt 0)

    WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



    However, this is an *internal* error handler. The client, whether browser or robot, never sees anything but 200 *and* the desired content.

    Ya, I just tried it too after your comments, plumsauce. Nice. I stand corrected. :) Thanks!

    plumsauce

    12:10 am on Jan 24, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    ...shhh :)

    macrost

    5:35 pm on Jan 24, 2004 (gmt 0)

    10+ Year Member



    Matt,
    If you need the code, IM me and I'll send you the newest release.

    Same with anybody else, RossWal, have you implemented it?

    Mac
    <added>
    bakedjake - check out your posts: 666 haha! :o

    plumsauce

    10:23 am on Jan 25, 2004 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member




    And all those linux guys think they have it made :p

    RossWal

    12:54 am on Jan 27, 2004 (gmt 0)

    10+ Year Member



    Nope. Have it filed away for a rainy day though ;-)

    Thanks!