Solved

.htaccess and who

Posted on 1998-09-07
2
175 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
This article will show, step by step, how to integrate R code into a R Sweave document
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

756 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