Solved

.htaccess and who

Posted on 1998-09-07
2
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
This article will show, step by step, how to integrate R code into a R Sweave document
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

739 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