Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to use modrewrite to proxy http://myserver/cam1 to an internal, http-auth protected server at http://admin:admin@192.168.99.130/cgi/mjpg/mjpg.cgi

No matter what I try, though, requests to http://myserver/cam1 always prompt me for the username and password. I've tried all of these to no avail.

RewriteRule ^/cam1 http://admin:admin@192.168.99.130/cgi/mjpg/mjpg.cgi [P,L]
RewriteRule ^/cam1 http://192.168.99.130/cgi/mjpg/mjpg.cgi [E=Authorization:Basic\ YWRtaW46YWRtaW4=,P,L]
RewriteRule ^/cam1 http://192.168.99.130/cgi/mjpg/mjpg.cgi [E=HTTP_USERID:admin,E=HTTP_PASSWORD:admin,P,L]`

Anybody have any other ideas?

share|improve this question
add comment

1 Answer

Try to remove ^ and /:

RewriteRule cam1 http://admin:admin@192.168.99.130/cgi/mjpg/mjpg.cgi [P,L]
RewriteRule cam1 http://192.168.99.130/cgi/mjpg/mjpg.cgi [E=Authorization:Basic\ YWRtaW46YWRtaW4=,P,L]
RewriteRule cam1 http://192.168.99.130/cgi/mjpg/mjpg.cgi [E=HTTP_USERID:admin,E=HTTP_PASSWORD:admin,P,L]

Please tell me if it works.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.