title: How to redirect HTTPS to HTTP for some pages using .htaccess
body: <p>I am facing URL rewriting problem using .htaccess.</p>
  
  <p>I have to redirect all the URLs to HTTPS except 4 URLs. Below is the code in my .htaccess file:</p>
  
  <pre><code>RewriteEngine On
  Options +FollowSymlinks
  RewriteBase /
  
  RewriteCond %{HTTPS} on
  RewriteCond %{HTTP_REFERER} !^https(.*)/(.*)$ [NC]
  RewriteCond %{REQUEST_URI} ^/$ [NC]
  RewriteCond %{REQUEST_URI} ^/?index\.php$ [NC]
  RewriteCond %{REQUEST_URI} ^/?index\.php?view=default [NC]
  RewriteCond %{REQUEST_URI} ^/?index\.php?view=news [NC]
  RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301, NC, L]
  
  # Require SSL on all other pages
  RewriteCond %{HTTPS} !on
  RewriteRule ^(.*)$ https://%{HTTP_HOST}r%{REQUEST_URI} [R=301, NC, L]
  </code></pre>
  
  <p>I need to disable HTTPS for following URLs:</p>
  
  <ol>
  <li><code>mydomain.com/</code></li>
  <li><code>mydomain.com/index.php</code></li>
  <li><code>mydomain.com/index.php?view=new</code></li>
  <li><code>mydomain.com/index.php?view=new&amp;abc=xyz&amp;aaa=bbb…</code></li>
  <li><code>mydomain.com/index.php?view=default</code></li>
  </ol>
  
  <p>For above 5 URLs, I want to redirect in http, but it does not work. It redirects all the URLs to HTTPS only.</p>