CSS3 PIE Forums

not working with subdomains..
Page 1 of 1

Author:  no1youknowz [ Tue Oct 12, 2010 11:05 am ]
Post subject:  not working with subdomains..

Hey all,

I've got css3pie working fine for my site, but I have come across this issue.

If I have say http://www.domain.com it works fine. But if I have london.domain.com then pie fails to work.

Has anyone else come across this issue?

Just so you know, I am using mod_rewrite.

Edit: I have also built the latest build on git and its the same problem. So if anyone can suggest "anything" to fix this, would be great. :D


Author:  jason [ Tue Oct 12, 2010 5:00 pm ]
Post subject:  Re: not working with subdomains..

IE enforces a same-domain restriction on .htc behaviors. So the .htc file must be served from the exact same domain (including subdomain) as the HTML file that references it. Is that perhaps what you're running into?

Author:  no1youknowz [ Wed Oct 13, 2010 8:28 am ]
Post subject:  Re: not working with subdomains..

Hi Jason,

Yes, I thought that would be the issue, so I tried a few things last nite.

1) Turn off mod_rewrite, just in case apache was doing something with the url.
2) prefix http://www.domain.com/ into the <link> to load my css

I found that www. works fine. However when I change to a subdomain and change the css link to load from the subdomain, it still doesn't work.

So the same-domain restriction shouldn't really be an issue here. As I'm pulling the css from the same domain as the .html file is being called from.

Is there a way to find where PIE is being loaded from?

Is there any help you can give me to resolve this?


Author:  jason [ Wed Oct 13, 2010 10:00 am ]
Post subject:  Re: not working with subdomains..

I'd recommend using a tool like Fiddler to see exactly what HTTP requests are being made. This should tell you if PIE.htc is being loaded from the correct domain, and if it's being served with the correct content-type header.

Author:  no1youknowz [ Wed Oct 13, 2010 1:23 pm ]
Post subject:  Re: not working with subdomains..

Hi Jason,

I've been trying with IE7 before but when I tried with IE8 I found I was getting errors and this is what comes up:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Timestamp: Wed, 13 Oct 2010 19:18:34 UTC

Message: Access is denied to: http://www.domain.com/modules/csspie/PIE.htc
Line: 0
Char: 0
Code: 0
URI: http://london.domain.com/classifieds

This happens even when I have implicitly set the subdomain from where the css is loaded:

<link rel="stylesheet" media="screen" type="text/css" href="http://london.domain.com/css/main.css" />

However, I have got it working, but only when I then set the full path in the css file for PIE:

behavior: url(http://london.domain.com/modules/csspie/PIE.htc);

But this is not a workable solution for me. I have well over 35 subdomains...

I would suggest that the URL path that is used presumes that WWW is always used, perhaps? If so, to use the URL that is set when loading the css.


Author:  jason [ Wed Oct 13, 2010 3:34 pm ]
Post subject:  Re: not working with subdomains..

That's strange indeed. Unfortunately the behavior loading mechanism is internal to IE so there's nothing we can do to change it.

I would like to know better why IE is choosing the www. subdomain. Can you think of anything in your setup that would force that? A <base> tag, some meta tag or http header that might make IE load dependencies from a different subdomain?

Author:  no1youknowz [ Wed Oct 13, 2010 3:59 pm ]
Post subject:  Re: not working with subdomains..

jason wrote:
A <base> tag

That was it.. /face-palm

I had it in my header, I forget why it's there. Anyway its gone now and its working :D

Thanks so much for taking the time to troubleshoot this and for making css3pie.

Look forward to beta3 and hopefully to text-shadows.

Thanks to this wonderful piece of code, you've now made IE7/8 with my site as good as firefox 3.6 lol !

Author:  jason [ Thu Oct 14, 2010 4:52 pm ]
Post subject:  Re: not working with subdomains..

Great, thanks for letting me know it was the <base> tag that was doing it. I'll be sure to add that to the upcoming troubleshooting guide as a possible gotcha.

Page 1 of 1 All times are UTC - 7 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group