This is my current .htaccess file:RewriteEngine OnErrorDocument 404 /404.html# 1RewriteRule ^extra/([0-9]+)/(.*).html?$ pages.php?do=view&id=$1RewriteRule ^special-bonus/([0-9]+)/(.*).html?$ pages.php?do=bonus&id=$1RewriteRule ^thankyou/(.*).html?$ static.php?do=thankyou&prod=$1# 2RewriteRule ^list.html pages.php?do=listRewriteRule ^about.html static.php?do=about# 3RewriteRule ^404.html static.php?do=404RewriteRule ^room.html room.php# 4RewriteRule ^sitemap.xml sitemap.phpI would like to force HTTPS (SSL) on every page except room.html. How can I do that? I am using Apache HTTP Server (ver 2.2.x).To force HTTPS on every page I was using:RewriteEngine OnRewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://www.mycookiedomain.com/$1 [R,L]It was working great but now I have to make change so it works on every page except room.html and I have no idea how to do that.
htaccess force HTTPS except one page
htaccess;redirects;apache;https
Using your example, you can use an out in your code.RewriteEngine On# Go to https if not on room.htmlRewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} !^/room.html$ [NC]RewriteRule ^(.*)$ https://www.mycookiedomain.com/$1 [R,L]# Go to http if you are on room.htmlRewriteCond %{SERVER_PORT} !80 RewriteCond %{REQUEST_URI} ^/room.html$ [NC]RewriteRule ^(.*)$ http://www.mycookiedomain.com/$1 [R,L]You will likely have to tailor this a bit for your needs, but this example is at least close.