title: Mixed Content Page: requested an insecure stylesheet error
body: <p>I have a website working on it. when i open any page with http:// protocol, every thing is loaded correctly, but when i try to load the page with https protocol, the page loaded but without css and javascript file. <br> The console shows the following errors.</p>
  
  <blockquote>
    <p>Mixed Content: The page at
    '<a href="https://www.example.com/index.php?main_page=login">https://www.example.com/index.php?main_page=login</a>' was loaded
    over HTTPS, but requested an insecure stylesheet
    '<a href="http://www.example.com/site_map.html">http://www.example.com/site_map.html</a>'. This request has been
    blocked; the content must be served over HTTPS.</p>
  </blockquote>
  
  <p>I figured that the problem is the browser can not load any css files when it requested by https protocol. <br >
  The problem is with htaccess file, because when i removed it, the css files loaded correctly. <br> <br></p>
  
  <p>The page and css files loaded to browser with https in their urls like this</p>
  
  <pre><code>&lt;link rel="stylesheet" type="text/css" href="https://www.example.com/includes/templates/classic/css/style1.css"&gt;
  &lt;link rel="stylesheet" type="text/css" href="https://www.example.com/includes/templates/classic/css/style2.css"&gt;
  </code></pre>
  
  <p>when the browser tries to load the css files, it is redirected to</p>
  
  <pre><code>http://www.example.com/site_map.html  
  </code></pre>
  
  <p>How can i make htaccess allow https to open the css and js files in a specific folder? <br> <br>Thanks</p>
  
  <p><strong>UPDATE</strong>
  The htaccess file content</p>
  
  <pre><code>RewriteEngine On
  RewriteCond %{SERVER_PORT} ^443$
  RewriteRule (.*) http://www.example.com/$1 
  ###############################################################################
  # Common directives
  ###############################################################################
  # NOTE: Replace /shop/ with the relative web path of your catalog in the "Rewrite Base" line below:
  
  Options +FollowSymLinks
  RewriteEngine on
  
  RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
  
  RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
  RewriteRule ^index\.php$ http://www.example.com/ [R=301,L]
  
  #RewriteBase /
  
  ###############################################################################
  # Start Ultimate SEO URLs
  ###############################################################################
  
  # Original (unchanged) URL formats
  RewriteRule ^(.*)-p-([0-9]+)(.*)$ index\.php?main_page=product_info&amp;products_id=$2&amp;%{QUERY_STRING} [L]
  RewriteRule ^(.*)-c-(.*)-p(.*)\.html$ /index.php?main_page=$4&amp;cPath=$2&amp;sort=$5&amp;page=$3
  RewriteRule ^(.*)-c-([0-9_]+)(.*)$ index\.php?main_page=index&amp;cPath=$2&amp;%{QUERY_STRING} [L]
  RewriteRule ^(.*)-ez-(.*).html$ index.php?main_page=page&amp;id=$2 [L]
  
  # All other pages
  # Don't rewrite real files or directories
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index\.php?main_page=$1&amp;%{QUERY_STRING} [L]
  
  
  # Block out any script trying to base64_encode data within the URL.
  RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
  # Block out any script that includes a &lt;script&gt; tag in URL.
  RewriteCond %{QUERY_STRING} (&lt;|%3C)([^s]*s)+cript.*(&gt;|%3E) [NC,OR]
  # Block out any script trying to set a PHP GLOBALS variable via URL.
  RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
  # Block out any script trying to modify a _REQUEST variable via URL.
  RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
  RewriteRule   index.html$  index.php [QSA] 
  
  
  # 480 weeks
  &lt;FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$"&gt;
  Header set Cache-Control "max-age=290304000, public"
  &lt;/FilesMatch&gt;
  
  # 2 DAYS
  &lt;FilesMatch "\.(xml|txt)$"&gt;
  Header set Cache-Control "max-age=172800, public, must-revalidate"
  &lt;/FilesMatch&gt;
  
  # 2 HOURS
  &lt;FilesMatch "\.(html|htm)$"&gt;
  Header set Cache-Control "max-age=7200, must-revalidate"
  &lt;/FilesMatch&gt;
  # compress text, html, javascript, css, xml:
  AddOutputFilterByType DEFLATE text/plain
  AddOutputFilterByType DEFLATE text/html
  AddOutputFilterByType DEFLATE text/xml
  AddOutputFilterByType DEFLATE text/css
  AddOutputFilterByType DEFLATE application/xml
  AddOutputFilterByType DEFLATE application/xhtml+xml
  AddOutputFilterByType DEFLATE application/rss+xml
  AddOutputFilterByType DEFLATE application/javascript
  AddOutputFilterByType DEFLATE application/x-javascript
  
  RewriteEngine on
  RewriteBase /
  
  ErrorDocument 404 /index.php
  RewriteRule   index.html$  index.php [QSA]
  </code></pre>