imathis / octopress

Octopress is an obsessively designed framework for Jekyll blogging. It’s easy to configure and easy to deploy. Sweet huh?
http://github.com/imathis/octopress
9.31k stars 2.62k forks source link

Sites Render Differently in IE8 Depending On URL (www or no www) #89

Closed bensternthal closed 13 years ago

bensternthal commented 13 years ago

I ran into this on my personal site and can confirm it occurs on other sites listed on the wiki.

Description When a site is viewed in ie8 with the www url, the layout of the site appears broken. You can see an example screenshot here: http://dev.devpatch.com/octopress-issue.png

Steps To Reproduce Use IE8 and go to http://devpatch.com and then http://www.devpatch.com You can also try this with http://zanshin.net/

Notes I suspect this is caused by respond.js not calling in the stylesheet via ajax when www is used. On octopress.org there is a 301 redirect from www.octopress.org to octopress.org which is why (i suspect) this is not seen there.

I figured I would post this here and not on respond.js just in case something else funky is going on.

zanshin commented 13 years ago

I've added code to my .htaccess file to redirect www.zanshin.net to zanshin.net, which does an end run around this issue, but it is still something that ought to be corrected. For the curious, here's the code I put in my .htaccess:

RewriteEngine on RewriteBase /

RewriteCond %{HTTP_HOST} ^www.zanshin.net$ RewriteRule (.*) http://zanshin.net/$1 [R=Permanent]

imathis commented 13 years ago

As best I can tell this is an issue with cross site scripting. I always set up my hosting to redirect the www subdomain and I think that's a generally recommended practice. Thanks @zan5hin for posting an easy way to do it.

bensternthal commented 13 years ago

Hmm, i'll try to poke around on this early next week both because I would like to understand the cause and because this should work. Redirecting the subdomain is not really an accepted best practice and should not be a requirement of using octopress.

If/when I figure this out... i'll post the solution :-)

imathis commented 13 years ago

I agree this shouldn't be a barrier for using Octopress. Unfortunately it seems like the solution lies in tools I didn't create and am unable to fix. If you can find a solution that doesn't require redirection I'd be very pleased to know how to implement it.

bensternthal commented 13 years ago

Just an FYI here is the bug thread on this over at modernizer. https://github.com/Modernizr/Modernizr/issues/348

For a temp fix, I removed respond.js from my modernizer build and included separately. If this was an older browser I would probably ignore on my personal site but ie8 is still very popular.

Anyhew hope this helps.

imathis commented 13 years ago

Very good thanks so much for figuring this out. I wish I could hotlink to the build so updates would be automatic. I'll have to figure out what to do with Octopress.

NJAldwin commented 13 years ago

re: hotlinking the build, have you tried using git submodules? http://help.github.com/submodules/

allegromanontroppo commented 13 years ago

I've managed to solve the issue by replacing the Regex in Modernizr as per ryanseddon's comment on their thread.

Looks like modernizr is using a slightly different regexp compared to the current one in respond.

Modernizr has: !/^([a-zA-Z]+?:(\/\/)?(www.)?)/

Respond has: !/^([a-zA-Z]+?:(\/\/)?)/

Not perfect but it does the job.