Updated: CSS Styles lost when aggregating, compressing CSS in Drupal 7.24

Note: This problem happens with a Shared hosting server using Nginx.

I recently launched a website using the latest version of Drupal 7.24. After launching, I went to the Admin page at sitename.com/admin/config/development/performance and checked the box to Aggregate and Compress CSS files. All my site's CSS styling promptly disappeared. So, of course, I disabled this checkbox.

Then I checked the box to Aggregate Javascript files and my Admin Menu toolbar promptly disappeared.

I don't know what's causing this problem. Could it be the new .htaccess files that are included with the new Drupal 7.24? I understand that the new .htaccess files in the sites/default/files/css and /tmp directories is helpful to prevent hacking. 

Anyone else have problems with CSS styling disappearing?

Update: Feb. 20, 2014

This post on Drupal.org may be helpful for some: https://drupal.org/node/1335366

After hours of testing, I found the solution for me:

My web host tech support confirmed that they are running Nginx on my shared hosting server at Hostgator.com. However, my situation is a bit different than jgeist, I didn't have problems with IE but with Firefox and Chrome.
 
I was able to solve the problem by removing the new .htaccess files recommended by Drupal 7.24 for the files/css and /tmp directories
- After I removed the .htaccess file from home/username/tmp,  my admin menu came back when "Aggregate Javascript files " was turned on
- I also removed the .htaccess file in sites/default/files and then my site styling came back when "Aggregate and Compress CSS" files was turned on.
- "Compress Cached files" is also turned on.
- I used the root .htaccess file from Drupal 7.24 AS IS

Note: When clearing the browser cache using the browser settings, you will be automatically logged out of Drupal's admin panel.

In Summary:

I'm using these settings:

1. "Aggregate and compress CSS files" is checked.

2. "Aggregate JavaScript files" is checked.
 
3. "Compress cached pages" is also checked.

Solution:

  • I removed the new .htaccess files from sites/default/files and /tmp recommended by Drupal 7.24
  • I am using the root .htaccess file that comes with Drupal 7.24 AS IS.

I hope someone else finds this helpful. Please leave your comments below:

Here is another resource that might be helpful:
http://stackoverflow.com/questions/4480562/drupal-aggregate-css-not-working-all-styles-gone

Comments

My two cents (Drupal

My two cents (Drupal 7.43/Php5 I don't know if delete .htaccess file in sites/default/files is a right way for files folder 'cause it manage permissions of public/private files. BTW, I had the same problem in my shared italian hosting (it also using Nginx) and after hours of headache i was suddenly reminded that it has deprecated the old: Options +FollowSymLinks in favor of Options +SymLinksIfOwnerMatch So i changed my .htaccess(sites/default/files) in this way: #Options +FollowSymLinks Options +SymLinksIfOwnerMatch As if by magic, layout newly appear as it should :-) Regards

Imagecache directory unwriteable in Drupal 6.30

I'm having similar problems with Drupal 6.30. The new .htaccess file recommended for /files directory causes the Imagecache directory to become unwriteable. So I removed it.

I'm using shared hosting that uses Nginx web server. I uploaded a PHP script and tried to run it in the /files directory and it did not execute. My Nginx server seems to have its own configuration that prevents malicious scripts from running in the /files directory.

The note regarding Nginx servers in the Security Advisory located here: https://drupal.org/SA-CORE-2013-003 is incorrect when it says the the new .htaccess files will have no effect.