Re: Rewrite Rules, SSL, and .htaccess

From: Jeff Bollinger (jeff01_at_email.unc.edu)
Date: 03/25/04

  • Next message: Wallwork, Nathan: "Re: Rewrite Rules, SSL, and .htaccess"
    Date: Thu, 25 Mar 2004 16:30:19 -0500
    To: focus-linux@securityfocus.com
    
    

    > Subject:
    > Rewrite Rules, SSL, and .htaccess
    > From:
    > "davec" <davec@webpipe.net>
    > Date:
    > Wed, 24 Mar 2004 23:47:15 -0700
    > To:
    > focus-linux@securityfocus.com
    >
    > To:
    > focus-linux@securityfocus.com
    >
    > Hi,
    > I have a .htaccess file protecting a certain directory on my site. When
    > I tried using the following Apache redirect, I was prompted for my
    > password once on the http version, and once on the https version:
    > <VirtualHost 192.168.3.7:80>
    > Redirect / https://www.mydomain.com/
    > </VirtualHost>
    > The point of using SSL on the password protected directory is to protect
    > the password from being passed in clear text. I think that a RewriteRule
    > would probably do the trick, but after reading the apache documentation
    > (version 2.0.40) I have still not been able to set one up that works
    > properly for the various ways of accessing the site such as
    > http://www.mydomain.com/dir or www.mydomain.com/dir or mydomain.com/dir
    > or http://www.mydomain.com/dir/index.html etc.
    > Any suggestions?
    > Thanks,
    > Dave

    How about just trying this:

    <VirtualHost 192.168.3.7:80>
    RedirectMatch permanent .* https://www.mydomain.com$1
    </VirtualHost>

    -- 
    Jeff Bollinger, CISSP
    University of North Carolina
    IT Security Analyst
    105 Abernethy Hall
    mailto: jeff @unc dot edu
    

  • Next message: Wallwork, Nathan: "Re: Rewrite Rules, SSL, and .htaccess"

    Relevant Pages

    • Re: Is this a common way to use CGI?
      ... have access to the server config file, so I'm putting the .htaccess ... directory with the .htaccess file in it i.e. webroot ... Do you have to use `.htaccess' because you cannot edit the main Apache ... rewrite rules only to the remainder. ...
      (comp.unix.programmer)
    • Re: mod_rewrite not working with .htaccess
      ... I put gibberish in my .htaccess file, and it fired an error, ... rewrite rules in httpd.conf, they work fine. ... in .htaccess, they don't work. ... In addition to that you can check out the current value of AccessFilename. ...
      (comp.infosystems.www.servers.unix)
    • .htaccess and SSL
      ... Apache .htaccess file for authentication. ... but the authentication is still with Apache. ... I am still relatively new to the intracacies of Apache and SSL. ...
      (Security-Basics)
    • mod_rewrite not working with .htaccess
      ... I am having trouble using mod_rewrite and .htaccess. ... rewrite rules in httpd.conf, they work fine. ... Options +FollowSymLinks ...
      (comp.infosystems.www.servers.unix)
    • Re: mod_rewrite not working with .htaccess
      ... Leo wrote: ... rewrite rules in httpd.conf, they work fine. ... in .htaccess, they don't work. ... I even have AllowOverride all enabled. ...
      (comp.infosystems.www.servers.unix)