Forum Moderators: phranque
So, in other words. Redirection based on the user that logs in via the login page.
From the main "MEMBERS" directory
If "USER1" enters the correct password then that user will redirected to "firstuser" directory.
If "USER2" enters the correct password then that user will be redirected to "seconduser" sub directory.
I currently have:
This is good to allow the same directory to be open to the 1 user, but i need mutple users, and multiple redirects.
AuthType Basic
AuthName "members"
AuthUserFile "/home/*******/.htpasswds/public_html/members/cgi-bin/members/passwd"
require valid-user
------------------------------------------
I need something like:
AuthType Basic
AuthUserFile "/home/*******/.htpasswds/public_html/members/cgi-bin/members/passwd"
AuthName "members"
require valid-user
satisfy any
#if it's user 'user1', do this
#Redirect /members/useraccounts/user1/
#if it's user 'user2', do this
#Redirect /members/useraccounts/user2/
and then so on for the rest of the other users.
Again:
- The Client hits a DIR using the login page with the .htaccess which asks for Username/Password
- Based on Username/Password, client is sent to a web page (with differing web pages for different clients)
Someone please help! I already have the login script in place ready to use when this is completed.
if user gives out the url to connect to the url, then the user should see the index.shtml page where the page will redirect them to the login page back in the main directory? ?
the code does not work, but must be something simple to do with this code to make it work rather than it just redirecting all users to the one page.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Username</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function Login(form) {
var username = form.username.value;
var password = form.password.value;
var server = form.server.value;
if (username && "user1" && password && server) {
loggedin=true;
window.location="useraccounts/user1/page.shtml";
}
if (username && "user2" && password && server) {
loggedin=true;
window.location="useraccounts/user2/page.shtml";
var htsite = "http://" + username + ":" + password + "@" + server;
window.location = htsite;
}
else {
alert("Please enter your username and password.");
}
}
// End -->
</script>
</head>
<body>
<form name=login>
<input type="hidden" name="server" value="www.mydomain.com/members/cgi-bin/login/l08dsk9jhnd3/">
Username:
<input type=text name=username size=20>
<br><br>
Password:
<input type=password name=password size=20>
<input type=button value="Login!" onClick="Login(this.form)" name="button">
</form>
</body>
</html>
Jim