.htaccess - redirect to https for all pages except 2

sabecs
sabecs used Ask the Experts™
on
Hi,
How can I turn https on for all pages to my website except pages below using .htaccess

www.myweb.com.au/subfolder/page1.php

&

www.myweb.com.au/otherfolder/otherpage42.php

Thanks in advance for your help
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Try this:
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !=/subfolder/page1.php
RewriteCond %{REQUEST_URI} !=/otherfolder/otherpage42.php
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial