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

biscuit technologies biscuit.tech at gmail.com
Wed Sep 17 15:38:46 MDT 2008


Excellent news.

As far as I know the order of elements inside the htaccess file
doesn't matter, but the syntax does and if you have other things going
on I'd put anything that process files first and redirects second -
but trying it both ways to see the difference wouldn't hurt.

- David

On Wed, Sep 17, 2008 at 2:29 PM, Troy Meyers <tcmeyers at troymeyers.com> wrote:
> David,
>
> I haven't looked at the files you attached yet, but only because I do think the one modification to httpd.conf did do the trick, I just flummoxed myself into thinking it hadn't. I will look at these files to see what I can learn, though.
>
> In the mean time, I changed my root-level .htaccess file to what your second suggestion was:
>
> RewriteEngine On
> RewriteCond %{HTTPS} off
> RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
>
> ... and sure enough, initial testing does infact do the rewrite so that if I put in the browser:
> http://192.168.1.105/phpinfo.php
> ...it's immediately redirected to:
> https://192.168.1.105/phpinfo.php
>
> Other files in that directory level also work similarly. Next I'll try files in deeper folders, and also see if it work if directory names work, instead of just file names.
>
> I'm feeling very hopeful, thank you so much.
>
> My final step, I think, is to integrate this with the existing .htaccess I'm using on the current non-SSL-only machine, the one that does the Blackbelt rewrites.
>
> Would you think I'd just put this set of commands first?
>
> -Troy
>
>
>
>> OK, attached is my httpd.conf, my user conf (dlw.conf) and a sample
>> showing that mod_rewrite works. There's an .htaccess file in the rewrite
>> folder that won't show up in the finder but will by going to the folder
>> in Terminal and doing an ls -al.
>>
>> I also did a chown www:www on the .htaccess file which I think made a
>> difference, but can't be sure 100%.
>>
>> Looking at the Console.app and the Apache logs will show you Apache
>> errors and if Apache fails to start up you will actually not know just
>> by looking the the Web sharing checkbox (!!) but the logs will tell you.
>>
>> Let me know how it goes,
>>
>> David
>
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
>


More information about the FX.php_List mailing list