Forum Moderators: open
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
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.
+++
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.
-Matt