Well, if the second case will only be used for SSL, there are lots of ways that you could separate out those two in .htaccess. I find that I always have to play around until I get it right, however. Check the Apache docs or search for .htaccess tricks.
You should be able to use
RewriteCond %{SERVER_PORT} 443
and
RewriteCond %{SERVER_PORT} 80
or set up a Virtual Host for each.
Thanks Zap, that did the trick! Previously I tried using {HTTPS} !=on etc. but it didn’t work.
I now have just about all the pieces in place to allow selective encryption of MODx pages, based on a TV checkbox. I’ll clean it up and post it as a How To when I have finished it.
Andy
Oooooh! That would be a VERY nice trick indeed! I have been setting some pages for ShopX to https only in .htaccess, but it would be so much more user-freindly if it could be set via a TV (or by choosing a specific template).
Should have it finished in the next day or so. Only problem left is to ensure that a form on an encrypted page is POSTed using encryption, and I think I have an easy solution for that.
Andy
That shouldn’t be a problem, since MODx writes its URLs relatively anyway...
That’s excellent! It will be useful for a lot of different purposes, including ShopX, login screens, etc. I suggested using a template instead of a TV as the trigger because I tend to have an SSL template with an https base href and other specific SSL files (mostly to avoid partially-encrypted pages; I used to add Google Analytics SSL code in those also, but now the plugin can recognize that the page is SSL and add the correct links).