<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12pt">Thank you for your help.<br><br>I've added it to the virtual host definition and it will not even ask for a password.  <br><br>I was looking in the ssl_errors file, however I find nothing.<br><br>How can I troubleshoot this?  I want to get basic auth working first.  (auth works using a .htaccess file)<br><br>I've inserted the following into the vhost.<br><br>Directory /home/user-name/public_html/directory-name-to-secure/><br>  AuthType Basic<br>  AuthName "Restricted"<br>  AuthUserFile /path/to/htaccess/password/file (it is outside the doc root)<br>  Require user user-name-in-the-htaccess-password-file-listed-above<br></Directory><br><br><div><span>This is on a CentOS 6.x server.</span></div><div style="color: rgb(0, 0, 0); font-size: 16px;
 font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><br><span></span></div><div style="color: rgb(0, 0, 0); font-size: 16px; font-family: HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif; background-color: transparent; font-style: normal;"><span>Thank you for your insight!!<br></span></div><div> </div><div>------------------------<br>Keith Smith</div><div style="display: block;" class="yahoo_quoted"> <br> <br> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> On Monday, January 13, 2014 7:13 PM, Matt Graham <mhgraham@crow202.org> wrote:<br> </font> </div>  <div class="y_msg_container">On 2014-01-13 18:29,
 keith smith wrote:<br clear="none">> RewriteEngine On<br clear="none">> RewriteCond %{SERVER_PORT} 80<br clear="none">> RewriteCond %{REQUEST_URI} folder<br clear="none">> RewriteRule ^(.*)$ <a shape="rect" href="https://www.domain.tld/folder/$1" target="_blank">https://www.domain.tld/folder/$1 </a>[R,L]<br clear="none">> <br clear="none">> AuthUserFile /path/to/password/file/.htpasswd_file<br clear="none">> AuthType Basic<br clear="none">> AuthName "Log in Please"<br clear="none">> require user username<br clear="none">> <br clear="none">> It allows me to authenticate, however sometimes it is HTTP and other<br clear="none">> times it is HTTPS.<br clear="none"><br clear="none">Is this in a vhost?  I would think you'd be better off putting all of <br clear="none">this into a <Directory> in a config file, not a .htwhatever file if you <br clear="none">can swing that.  Anyway, the following worked a tiny
 bit bit better for <br clear="none">me than the things you had:<br clear="none"><br clear="none"># NOTE:  You'll have to alter the paths for your setup<br clear="none"><Directory /var/www/localhost/htdocs/folder><br clear="none">RewriteCond %{SERVER_PORT} 80<br clear="none">RewriteRule ^(.*)$ <a shape="rect" href="https://crow202.org/folder/$1" target="_blank">https://crow202.org/folder/$1 </a>[R=301,L]<br clear="none"><br clear="none">AuthUserFile /var/www/localhost/htdocs/folder/.htpassword<div class="yqt5751036088" id="yqtfd82833"><br clear="none">AuthType Basic<br clear="none">AuthName "Log in Please"</div><br clear="none">Require user testuser<br clear="none"></Directory><br clear="none"># end config file fragment<br clear="none"><br clear="none">...you can see what this does if you go to <a shape="rect" href="http://crow202.org/folder/" target="_blank">http://crow202.org/folder/ </a><br clear="none">(username testuser , password
 testpass).  It might have flaws or <br clear="none">problems that I don't know about, since I have no idea about the rest of <br clear="none">your apache setup.  AFAICT, though, it gets rid of the "I have to log in <br clear="none">via HTTP-Auth Basic twice, once over 80, once over 443" problem.<br clear="none"><br clear="none">-- <br clear="none">Crow202 Blog: <a shape="rect" href="http://crow202.org/wordpress" target="_blank">http://crow202.org/wordpress</a><br clear="none">There is no Darkness in Eternity<br clear="none">But only Light too dim for us to see.<br clear="none">---------------------------------------------------<br clear="none">PLUG-discuss mailing list - <a shape="rect" ymailto="mailto:PLUG-discuss@lists.phxlinux.org" href="mailto:PLUG-discuss@lists.phxlinux.org">PLUG-discuss@lists.phxlinux.org</a><br clear="none">To subscribe, unsubscribe, or to change your mail settings:<br clear="none"><a shape="rect"
 href="http://lists.phxlinux.org/mailman/listinfo/plug-discuss" target="_blank">http://lists.phxlinux.org/mailman/listinfo/plug-discuss</a><div class="yqt5751036088" id="yqtfd58323"><br clear="none"></div><br><br></div>  </div> </div>  </div> </div></body></html>