Magento - CSS没有加入magento

I have installed Magento on live server. But the problem is that its not loading css. I have double checked .htaccess file but There is nothing any issue in it. I have given full access permission on Var, Media & app/etc folder.

Please let me know that what is the issue ?

Thanks in advance.

Alex S.

View the source of your page and click the css links, if it is pointed correctly it should bring you to the css page.

For htaccess, make sure the RewriteBase / is uncommented. So from #RewriteBase / to RewriteBase /. Check the error log if possible. And, another thing i remember, you may need to clear your cache and tmp folder too. Do this first, clear cache and tmp folder.

Check permissions for the folders like app/etc, var, media folders. Try to give 777 permissions to those folders. Recently I have faced the same problem and I tried with this. Then my site works fine.

At the time of installation magento asked about secure URL and unsecure URL. These urls must be changed when we change our server. If you couldn't access admin >> system >> configuration

Then you could change it from database. Find in table

dbprefix . core_config_data

change path

web/unsecure/base_url to your new domain name
web/secure/base_url to your new domain name

Note : Please don't forget to put forward trailing slash at last. like: www.newdomain.com/

Thanks.

When you changed base_url path in Mysql

as : web/secure/base_url = http://example.com/

Must mention / at the end of .com
Then clear session and cache.
Then restart MySQL and Apache2.
Similar for unsecure/base_url.

In my case it is due to .htaccess file. In my project there is an .htaccess file in /skin folder with following content:

Header set Access-Control-Allow-Origin "*"

I have removed this file and it works fine.

I will suggest follow step by step.

There is 2 case:

1) You can see your CCS directly from URL, so browser load it by direct URL, example: http://your-magento/skin/frontend/your-package/your-theme/css/styles.css, so in this case you should check points connected with Magento:

  • Check/Correct Base URL from config or DB
  • Clear Cache
  • Clear Sessions
  • Check Configurations

2) If your CSS is not loading by direct URL. So in this case it is not connected with Magento at all. In this case you should check follwoing points:

  • Check files and folders permissions
  • Check rewrite rules and modules
  • Server Log files to find error
  • Check .htaccess for existance and for correctness.
  • Important, check all .htaccess files in all sub-folders.

In my case, I differed this 2 cases and start seaching my issue in second case.

I found .htaccess in folder /skin/frontend/your-package/your-theme/ The content was following:

Order deny,allow
Deny from all

Remove this file and your CSS files will be loaded. I don't know how this file was created, I don't have file like this in parent theme. I think Magento is automatically created it. Be attentive and follow changes with GIT.