[FX.php List] [OFF] Rewrite for forcing http to https possible?

Troy Meyers tcmeyers at troymeyers.com
Thu Sep 11 18:20:11 MDT 2008


David,

I'm using the Apache 2.2 as comes with Leopard, and I've added the Entropy PHP 5.5 (Release 6) which is working (phpinfo works).

The directory that httpd.conf is slightly different in this installation, it's
/private/etc/apache2/httpd.conf
But no matter, that's to be expected.

Searching for "mod_rewrite" in httpd.conf all I found is:
LoadModule rewrite_module libexec/apache2/mod_rewrite.so
which is not commented out... but that's the only thing I found.



Looking at the httpd.conf file in the other older Apache (1.3) server that's in use instead of testing, I find these things:

LoadModule rewrite_module     libexec/httpd/mod_rewrite.so
....
AddModule mod_rewrite.c
.....
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_METHOD} ^TRACE
    RewriteRule .* - [F]
</IfModule>



Going back to the Apache 2.2 one which is the subject of my problem, I looked for any instance of "AddModule" in the httpd.conf file, and there aren't any. It seems like 2.2 must work differently, because the 1.3 has tons of them. So I guess that's not the problem.

I don't know. I guess I'll Google more to see if I can find instructions on how to turn this on for Apache 2.2, because if the test was correct, it isn't.

Thanks.

-Troy






> There's a couple of things to look into. I'm on 10.4.11 and using
> entropy's php, so you might have some differences, but this is what I
> just did. go to /etc/httpd/httpd.conf using your preferred text editor
> (for simplicity sake I used nano) and do a find (cntl-w, ("where")) for
> mod_rewrite and check that it isn't commented out. Mine was fine.
> 
> upload the rewrite test to your /Library/Webserver/Documents folder
> with the sample php file and sample .htaccess file and if needed do a
> sudo apachectl restart graceful and give it a try. on my little mini it
> seems to work ok.
> 
> if you are accessing a user site folder you'll need to adjust the
> settings in /etc/httpd/users/youruser.conf and that's explained more or
> less well at
> http://michaelkrol.com/2005/11/21/enable-mod_rewrite-on-os-x-104-tiger/
> but to be honest I've had a lot easier time always using the root
> (/Library/Webserver/Documents) directory for serving custom stuff.
> 
> - David



More information about the FX.php_List mailing list