Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect? .htaccess?

Status
Not open for further replies.

danomaniac

Programmer
Jan 16, 2002
266
US
It appears there is high demand for assistance on these topics. What's one more?

I have directories in my site that I'm using .htaccess to protect. Each directory is for a specific vendor so they can access their information and download spreadsheets and stuff. and within each directory is a .htaccess file that requires just that user. Works fine.

I have a link on my main page to a secure vendor login page.
On that page, the vendor enters their login id and pw and are redirected to their page in their directory using a simple redirect script. Once there, of course .htaccess takes over and prompts for authentication. When they authenticate, the browser goes blank. If I remove the .htaccess file, the redirect works fine, so I know that is ok. If I call the protected page directly (with .htaccess in place) everything works, so I know that's ok. I just can't mix the two.

Can I make the redirect script pass the user id and pw to .htaccess so the vendor can browse through their area without authenticating again?

My goal is: One link to secure login. Enter user id/pw - immediately go to your specific area.

Is there an easier/more elegant way to set this up? Bottom line is, I don't want a page that has links for all vendors because I don't think that looks professional.

Thanks for any help/advice.


 
Wullie,
Thanks again for the assistance. It seems I'm becoming dependant on it.

I'm having trouble understanding what you're telling me, So I went another way...

This is what I have...

On my site, there's a link to vendor login, it takes you to /vendors/index.html

In /vendors/ there is a .htaccess file that requires valid-user.

Once the vendor logs in, /vendors/index.html loads.

On this page, there are links to each vendors area.

vendor1, vendor2, vendor3, etc.

each link takes them to
/vendors/vendor1/index.html
/vendors/vendor2/index.html
/vendors/vendor3/index.html
etc.

within each directory under /vendors/ there is a
.htaccess file that in turn requires user vendor1 ,vendor2, etc.

It all works now and I could leave it, and I may, but It requires them to log in twice, and they can see a list of other vendors (tacky)

In the first .htaccess file, /vendors/.htaccess, which requires any valid user, can I make it send each authenticated user to a specific url? I think this would solve both problems.

Thanks very much for your time and effort.

 
Hi mate,

I have thought about this and I think the best way to do it would be to use a perl (or similar) script to detect the user and pass and redirect them to the appropriate dir..

You could also get the script to format the url in the form of user:pass@domain.com so that the .htaccess file does not require a further login..

I personally cannot help you with a script of this type but I'm sure someone in the perl forum will..

Hope this helps Wullie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top