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

Troy Meyers tcmeyers at troymeyers.com
Wed Sep 17 09:55:14 MDT 2008


David,

Thanks for asking.

It didn't work for me, but I just think that mod_rewrite still isn't enabled, and nothing there seemed to change it. I'm sure (at least I hope) it's something simple. That page, though it's marked "solved" suggested some divergent ideas in different forks of the thread and it's not clear what I should have and shouldn't have done. The answer _might_ be there but the combinations I tried did not yield results. The thread itself didn't really seem to be directly addressing my problem, so I'm not sure if the key is really in there.

I had to temporarily drop the issue last week, but will be returning to it. If you have any other suggestions, I'd appreciate it.

To recap, it still looks like I'm stuck because mod_rewrite doesn't seem to be enabled, as evidenced by several trial versions of RewriteRule sequences for causing http: to switch to https: not doing anything, and because the separate mod_rewrite test page indicates that it is not "on".

-Troy 


> Hi Troy,
> 
> I curious to know if you've got this solved and if so, how?
> 
> - David


On Thu, Sep 11, 2008 at 9:18 PM, biscuit technologies
<biscuit.tech at gmail.com> wrote:
> Hi troy,
> according to this:
> http://michaelkrol.com/2007/10/30/local-web-development-with-os-x-105-leopard/
> mod_rewrite is on by default in leopard's apache 2.2
> apache 2 is quite a bit different from previous versions in some ways and
> I'm not that familiar with it, but I think this thread on the apple
> discussions site is pretty thorough:
> http://discussions.apple.com/thread.jspa?threadID=1453778&tstart=8
> maybe that will help,
> David
> On Thu, Sep 11, 2008 at 5:20 PM, Troy Meyers <tcmeyers at troymeyers.com>
> wrote:
>>
>> 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