开发者

Specific pages as always https and some others always http

开发者 https://www.devze.com 2023-03-19 09:40 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消