apache - htaccess blocking css and jscript -
hi have htaccess working, when go https blocks scripts , css. here example of error
[blocked] page @ https://bctech.com/checkout.php?session=41fb31bc29722f2e520877d612e0ea4b ran insecure content http://bctech.com/scripts/superfish.js.
im @ lost im new htacces
here example of css url im useing
<script type="text/javascript" src="/scripts/jquery-1.10.2.js">
and here attemp @ htaccess file, works blocks css , jscript files going wrong,, must close
.htacces code
<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{https} off rewriterule ^(checkout\.php|final\.php|admin/(.*))$ https://{http_host}/$1[r=301,l] rewritecond %{https} on rewritecond %{request_uri} !/(checkout\.php|final\.php|admin/(.*))$ rewritecond %{request_uri} !\.(css|js)$ [nc] rewriterule ^(.*)$ http://%{http_host}%{request_uri} [r=301,l] # sales: rewriterule ^shop/sales/?$ sales.php # primary categories: rewriterule ^shop/([a-z-aa-z\+]+)/?$ shop.php?type=$1 # specific products: rewriterule ^browse/([a-za-z\+]+)/([a-za-z\+\-]+)/([0-9]+)$ browse.php?type=$1&category=$2&id=$3 #for https pages: rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php?$1 [l,qsa] rewritecond %{the_request} ^[a-z]{3,}\s(.*)/index\.php [nc] rewriterule ^ /%1 [r=301,l] </ifmodule>
this rule here:
rewritecond %{https} on rewritecond %{request_uri} !/(checkout\.php|final\.php|admin/(.*))$ rewriterule ^(.*)$ http://%{http_host}%{request_uri} [r=301,l]
is redirecting https requests http, , chrome complaining because secure page (https) loading insecure script (http). script loaded via uri, protocol https, , rule redirecting http. try adding exception css , js rule:
rewritecond %{https} on rewritecond %{request_uri} !/(checkout\.php|final\.php|admin/(.*))$ rewritecond %{request_uri} !\.(css|js)$ [nc] rewriterule ^(.*)$ http://%{http_host}%{request_uri} [r=301,l]
Comments
Post a Comment