I want a few pages on my website to be always https and other pages to be always http.
If s开发者_如何转开发omeone visits the https page with http://, he should be redirected to https and vice versa, if someone visits the page meant to be over http:// with protocol https:// he should be redirected to http version
Use $_SERVER['HTTPS'] to detect if the user is already on an https connection, otherwise redirect using a 301 - Moved Permanently (all future requests should go to the intended https URL). Example for redirection is here.
精彩评论