Solved

.htaccess and who

Posted on 1998-09-07
2
164 Views
Last Modified: 2013-12-25
Hi!

How do I write a .htaccess file that sends one user that logs in somewhare and a other user somewhere else....

ex. User joe is going to html/joe and user boss to html/boss.
0
Comment
Question by:timeman
2 Comments
 
LVL 1

Accepted Solution

by:
evilgreg earned 200 total points
ID: 1828564
You can't. Htaccess only applies to files, and can't do anything more. You can, however, pass control to a simple cgi script
that can redirect to the correct page by checking out the username. In the example above for instance, htaccess could
protect access to a script that looked like this:

#!perl
$|++;
$name = $ENV{"REMOTE_USER"};
if ($name eq "joe") { $loc = "joe.html"; }
if ($name eq "boss") { $loc = "boss.html"; }
$location = "http://mysite.com/blahblah/$loc";
print "Location: $location\n\n";

A simple example, but you get the idea. Htaccess is simply
a password scheme, but has no filtering based on the
username. If you going to use a cgi script anyway, you
could even get rid of using htaccess and use the script
to validate (and filter) the users with a simple form.


0
 

Expert Comment

by:tong111797
ID: 2246842
how 2 call CGI script inside .htaccess ?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now