# Why Website loading without css and js

**URL:** <https://discourse.cakephp.org/t/why-website-loading-without-css-and-js/418>\
**Category:** Need Help\
**Created:** [May 29, 2016, 12:26pm UTC](https://discourse.cakephp.org/t/why-website-loading-without-css-and-js/418 "2016-05-29T12:26:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cakepramod](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@cakepramod](https://discourse.cakephp.org/u/cakepramod)\
**Post date:** [May 29, 2016, 12:26pm UTC](https://discourse.cakephp.org/t/why-website-loading-without-css-and-js/418/1 "2016-05-29T12:26:57Z")

</div>

Hello,

I am using CakePHP 2.6.3 version and it’s developed everything correct but I am not able to catch why website loading plain design sometime only, If I refresh again then It loading correctly and looks good. Only my website Body tag loading others all things are not loading what is reason? Please help me as soon as what is setting that’s not happen issue break design.

Thank you

---

<div class="post-metadata">

**Author:** ![joris](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/joris/32/338_2.png) [@joris](https://discourse.cakephp.org/u/joris)\
**Post date:** [May 29, 2016, 4:02pm UTC](https://discourse.cakephp.org/t/why-website-loading-without-css-and-js/418/2 "2016-05-29T16:02:10Z")

</div>

This seems to me more like a webserver disconfiguration.  
What webserver are you using?  
This can help: [http://book.cakephp.org/2.0/en/installation/url-rewriting.html#url-rewriting](http://book.cakephp.org/2.0/en/installation/url-rewriting.html#url-rewriting)

---

<div class="post-metadata">

**Author:** ![cakepramod](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@cakepramod](https://discourse.cakephp.org/u/cakepramod)\
**Post date:** [May 30, 2016, 2:46pm UTC](https://discourse.cakephp.org/t/why-website-loading-without-css-and-js/418/3 "2016-05-30T14:46:44Z")

</div>

No this is not a problem for mod rewrite URL. My issue come very rare not always I am facing. e.g It break website page and if I refresh again then seems good now. I think It should be cache or whatever something issue.

---

<div class="post-metadata">

**Author:** ![joris](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/joris/32/338_2.png) [@joris](https://discourse.cakephp.org/u/joris)\
**Post date:** [June 7, 2016, 10:17am UTC](https://discourse.cakephp.org/t/why-website-loading-without-css-and-js/418/4 "2016-06-07T10:17:10Z")

</div>

Is it possible you are returning the view without layout based on a condition, since does not return the head ?

---

<div class="post-metadata">

**Author:** ![cakepramod](https://avatars.discourse-cdn.com/v4/letter/c/ce73a5/32.png) [@cakepramod](https://discourse.cakephp.org/u/cakepramod)\
**Post date:** [June 7, 2016, 1:01pm UTC](https://discourse.cakephp.org/t/why-website-loading-without-css-and-js/418/5 "2016-06-07T13:01:28Z")

</div>

Yes It return without head

---

<div class="post-metadata">

**Author:** ![joris](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/joris/32/338_2.png) [@joris](https://discourse.cakephp.org/u/joris)\
**Post date:** [June 13, 2016, 4:49pm UTC](https://discourse.cakephp.org/t/why-website-loading-without-css-and-js/418/6 "2016-06-13T16:49:44Z")

</div>

Search your code for lines like:  
`$this->layout = null`  
or  
`$this->layout = 'ajax'`  
Seems to me like you disabled the layout and only return the content or you are just using an empty layout.
