由于网址路径错误,无法在magento中加载样式,如何解决此问题? [英] Styles not loading in magento due to wrong url path, how to solve this?

查看:92
本文介绍了由于网址路径错误,无法在magento中加载样式,如何解决此问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在本地系统上安装了magento,除了没有加载样式外,其他一切都工作正常.

I have installed magento on my local system, everything is working fine except that the styles are not loading..

我发现问题是由于发送请求时样式表网址不正确(在Firebug中使用net找到的.)

I observed that the problem was due to incorrect style sheet url when the request is being sent (found using net in firebug)..

请求网址:

http://se.com/var/www/se.com/skin/frontend/default/jm_wall/css/layout.css 

请求网址应为:

http://se.com/skin/frontend/default/jm_wall/css/layout.css 

我该如何解决这个问题?

How could I solve this problem?

其他信息:

  • 我已经从ubuntu 10.04(全新安装)从ubuntu 10.04迁移(在10.04上运行正常)
  • 我已经配置了apache虚拟主机
  • 我已设置web/unsecure/base_url&数据库中core_config_data表中的web/secure/base_urlhttp://se.com/
  • 我对var,skin和media文件夹拥有完全权限
  • Magento缓存已禁用和清理(出于安全考虑)
  • I have migrated from ubuntu 12.04 (fresh install) from ubuntu 10.04 (it was working fine on 10.04)
  • I have configured apache virtual hosts
  • I have set web/unsecure/base_url & web/secure/base_url to http://se.com/ in core_config_data table in the database
  • I have give full permissions to var, skin and media folders
  • Magento cache is disabled and cleaned (for safety)

推荐答案

朋友们我已经解决了这个问题.

Friends i have solved the problem..

我重做了之前完成的所有步骤,例如从svn获取所有文件,重新导入数据库以及更改web/unsecure/base_url& web/secure/base_url,配置apache虚拟主机等.

i redid all the steps that i have done before, like getting all the files from svn, re-importing the database, and changing the web/unsecure/base_url & web/secure/base_url, configuring apache virtual hosts etc..

但是我认为解决问题的方法是将媒体和var目录的所有权更改为www-data而不是kaushik,并赋予这些文件夹完全权限.

but i think what solved the problem was changing the ownership of media and var directories to www-data instead of kaushik and giving those folders full permissions.

我这样做是因为在主服务器中,这些目录归www-data用户所有.

I have done this step because in the main server, the those directories were owned by www-data user..

此外,我观察到css是从se.com/media/css文件夹加载的,该文件夹是在正确设置媒体目录后自动创建的,而这并没有更早发生,该目录具有css文件,如0a039da6028e6d636132ecd5e235f417.css等..

Also, i observed that the css was loading from se.com/media/css folder, which was automatically created once the media directory was setup properly, which did not happen earlier, the directory has css files like 0a039da6028e6d636132ecd5e235f417.css etc..

请求网址是这样的(来自Firebug的网络窗口)...

the request url was something like this (from net window in firebug)...

http://se.com/media/css/0a039da6028e6d636132ecd5e235f417.css 

和我在上面提到的内容(http://se.com/skin/frontend/default/jm_wall/css/layout.css)不一样,也不像请求的发送方式(http://se.com/var/www/se.com/skin/frontend/default/jm_wall/css/layout.css)

and not like the one i mentioned how it should be above (http://se.com/skin/frontend/default/jm_wall/css/layout.css), nor like how the request was sent (http://se.com/var/www/se.com/skin/frontend/default/jm_wall/css/layout.css)

希望这对其他人有帮助...

Hope this helps someone else...

这篇关于由于网址路径错误,无法在magento中加载样式,如何解决此问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆