The line
RewriteCond %{SERVER_PORT} !^80$
seems to indicate that your RewriteRule's are only applied if the
incoming request is NOT coming in from port 80 (port 80 is usually the
http:// port, while port 443 is usually the https:// port). The "!"
negates the pattern, so I think you will get into a loop if the
visitor is actually using https (443 != 80, so the first matching
RewriteRule is applied, which redirects to https, which uses port 443,
which is != 80, etc.) until the webserver fails about too many
redirects.
Try changing the condition, using ONLY ONE of the following:
- removing the exclamation point so that the condition matches when
using port 80
- changing the 80 to a 443 so that the condition matches when NOT
using port 443
- use the %{HTTPS} variable instead of %{SERVER_PORT}; and matching
the pattern ^off$. This should provide more flexibility in your
server configuration (for example using port 8080 instead of 80 for
your http: port ...
For additional details on using mod_rewrite (RewriteCond, RewriteRule,
etc.) you can check http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html
(Note: this is for Apache HTTP Server version 2.2; if your Apache
version is different, try changing the "2.2" in the URL to match your
version, such as 1.3 or 2.0).
As an alternative to drowning in the .htaccess file, you can use the
Security component. There is an example in the Cookbook (http://
book.cakephp.org/view/1308/Usage) showing how to force all admin
access to require secure SSL requests. If you need it for all
actions, it should be a trivial change from the example.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php