1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

.htaccess and custom redirects...???

Discussion in 'Web Design & Development' started by natefromri, Feb 14, 2005.

Thread Status:
Not open for further replies.
  1. natefromri

    natefromri Thread Starter

    Feb 14, 2005

    I am new to the forum, and have a technical question about .htaccess. Can you use .htacess to customize URL redirects depending on who is logging in? First, let me give you a little background.

    I work at a financial firm, and I have been using .htaccess to password-protect folders on our intranet which contain confidential information using the following .htaccess structure:

    AuthType WebProtect
    require costcenter 12505
    require user t1445 t1323 t2369 t4888

    This has allowed everybody in cost center 12505 as well as the unique employee #s t1445, t1323, t2369 and t4888 to gain access to the protected folder. How this has worked is that the user would be brought to a log-in page where they would log in using their Windows NT credentials.

    This has worked out fine for our needs up to now, but we are now working on providing specific reports for different individuals and my thought process was that perhaps I could somehow find a way to code the .htaccess for the reports page to allow for a custom URL redirect for each user. For example, we'd take out the cost center access, but for everybody else...

    t1445 would be redirected to t1445.html after login to see his reports
    t1323 would be redirected to t1323.html after login to see her reports
    t2369 would be redirected to t2369.html after login to see his reports
    t4888 would be redirected to t2369.html after login to see her reports

    This way nobody can see each other's reports, and there's only one log-in screen for everybody.

    Can this be done? If so, does anybody know how to code the .htaccess folder so that this would work? Thanks for any info you have on this!

  2. Squashman

    Squashman Trusted Advisor

    Apr 4, 2003
    Sounds like a complicated problem and solution. Seems like it would be just as easy to setup 5 different password protected folders. But I see what you are trying to do. You can then based on their group determine what folders they can access beyond the single login.

    Found some links that may give you some hints on how to accomplish this. I have never played around with Rewrite Conditions so you may have to do a little research.

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/330478

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice