I apologize in advance for asking something that's been answered several times on SO, but I haven't been able to modify any of the answers to work for this case.
I have a /secure/ folder that I need to redirect to HTTPS. Everything outside of that folder should be redirected to HTTP.
I plan on using absolute links for navigation through my site, but I need to guarantee that the pages in the /secure/ folder are only viewable over HTTPS. For the other pages it doesn't really matter, but I'd prefer them only viewable over HTTP because I'm on shared hosting and the server is already slow as it is.
Thank you very much!
Adapted an example on this page this page . See if the following works for you.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} secure
RewriteRule ^(.*)$ https://www.example.com/secure/$1 [R,L]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.