Jump to content

Redirect https request from sub-domain to main domain except for img css or js


Recommended Posts

This is driving me nuts if someone could help me that would be appreciated. Here is my setup Using Prestashop v1.5.3.1 Already have the standard rewrite conditions / rules for images that is generated by prestashop.

What I'm doing is running cookieless static content on sub-domains css1.url.com

Problem: When in HTTPS mode images are using HTTPS but ssl only works for main domain not sub domains so images / css / js won't work when on the ssl pages.

.htaccess that I'm using in css1.url.com.au

Options +FollowSymLinks

RewriteEngine On

RewriteBase /

 

redirect / http://www.url.com.au/

RewriteRule ^/(.*):SSL$ https://www.url.com.au/$1 [R,L]

RewriteRule ^/(.*):NOSSL$ http://www.url.com.au/$1 [R,L]

I tried adding this at the top

RewriteRule \.(css|js|jpe?g|gif|png|ico)$ - [L]

But images still redirect to HTTPS.

Can someone please help? I can post my main htaccess rules if you like but its pretty long.

Link to comment
Share on other sites

×
×
  • Create New...