Logo 
Search:

Asp.net Forum

Ask Question   UnAnswered
Home » Forum » Asp.net       RSS Feeds

Help on how to redirect web user based on login info...

  Asked By: Ricky    Date: Jan 21    Category: Asp.net    Views: 1325
  

my boss has given me the task of setting up a
IIS web server in mind to direct users to a particular web page.

I've done some investigating but come to a block and dont know
exactly whats wrong/wright with the code.

I'm no ASP developer but have some cold fusion experience.

Here's what I've got (using this guide
www.iisanswers.com/Top10FAQ/t10-redirectusers.htm)


<% set varUser = Request.ServerVariables("REMOTE_USER")

set objAdminGroup=GetObject("NT4://SERVER/mike")
If objAdminGroup.Member("NT4://SERVER/"&varUser) then
response.redirect = "http://SERVER/redirtest/mikehome"
end if %>

Am I correct in thinking NT4 is the winnt dir?


Here's a deeper, but probably more confusing explaination on what I
am trying to do...

User1 navigates over internet to http://mysite.com/
here they are presented with a User/Pass box
now depending on what authenticated user they provide should
determine where the go
so User1 gets directed to http://mysite.com/user1/
and User2 gets sent to http://mysite.com/user2

I hope this is possible and that some of you will help me out.

Thanks in advance,

Share: 

 

2 Answers Found

 
Answer #1    Answered By: Jay Richards     Answered On: Jan 21

That was the first real life problem I ever faced .... and I figured it out
before the scripts were freely available.

I had to, they wanted to charge me for redirection/subdomains and all the rest
of it.

Heres what to do.
DONT set your nameservers to your host, as then they got you by the short and
curlies.
Keep then at your regsitrar and change CName to point to your ip.

Do this for multiple domains and that domain will stay in the url.

So http://domain1.com AND http://www.domain2.com will BOTH end up at
http://you.rip.addy/index.aspx with their own urls in the address bar

Then just redirect  by pulling sites to folders from db && using
Response.Redirect.

There is another way where you generate 404 errors for every page, then redirect
from errors page(using server.Tranfer for that one as the correct page  and url
remain) Thats quite cool because if you define on page name only then
http://domain1.com/anyfolder/page1.aspx and
http://domain1.com/anyfolder2/page1.aspx both go to the same page so its good
for search engines and good for stupid users.
But its slower and not good for server  resources factor. Its neat but I wouldn't
use it, having said that, asp.NET uses errors via web.config so this would ease
the resources problem and put it entirely under your control.

But by far the best way is to use a HttpHandler or Module in your web  config, in
fact you don't even need any web pages. But besides that, it grabs the request
before itgets to any app, the handler is inherited by sub vrs so its easy, just
plonk it in your root and redirect from there.
And thats all I'm saying about it and it'll possibly be a while before you can
handle that sort of thing.
I'd give you the code  except I haven't written it yet. Will post it when I do
.... but I currently have a lot on my plate and it's min priority.

 
Answer #2    Answered By: Wade Jordan     Answered On: Jan 21

I'll give them a try.

Now where did I put that learn ASP in 24 minutes book...

 
Didn't find what you were looking for? Find more on Help on how to redirect web user based on login info... Or get search suggestion and latest updates.




Tagged: