3

I'm having a problem with CakePHP, the CSS is not found. When I view the source code in my browser I can see the cake generic CSS link in the head section. But when I click on it to see the actual source code, I get a 404 not found error.
i follow this actions:

  1. uncommented

    Configure::write('App.baseUrl', env('SCRIPT_NAME'));
    

    in app/config/core.php , because rewrite module is disable.

  2. delete .htaccess file from / and /app and /app/webroot.

  3. run project.

php code in default is :

app/View/Layouts/default.ctp

echo $this->Html->css('cake.generic');

and its html code is:

<link rel="stylesheet" type="text/css" href="/app/webroot/css/cake.generic.css" />

this file exist really, but when i click to /app/webroot/css/cake.generic.css in source of browser code i face

404 Not Found

Is way?

aya
  • 1,597
  • 4
  • 29
  • 59
  • Where is your virtual host document root pointing to? `app/webroot`? – Rob Sep 08 '13 at 05:43
  • my project in doorway folder and path is: `/home2/persianv/public_html/doorway/app/webroot` – aya Sep 08 '13 at 05:50

2 Answers2

1

I'm assuming your virtual hosts document root points to app/webroot so your links to the css files need to point to /css/file.css. The way you have it now it's actually looking for app/webroot/app/webroot/css and that's why you get a 404.

Either that or your .htaccess is wrong or you stylesheet doesn't actually exist. Let me know if this helps and i can update my answer if needed.

Rob
  • 12,659
  • 4
  • 39
  • 56
0

Already,i face this problem. i change permission for app and webroot and css folders. i offer this for you too.

parseha
  • 170
  • 1
  • 8