1

I seriously can't understand what is going on here. I just uploaded my web app from localhost to new domain-name on Windows IIS Server. When I try to access the web app, CSS files and images are not loaded and I get the following error:

"CssController could not be found."

I don't understand why it is doing this. Although I've written code like this in my default.ctp:

 echo $this->html->css('generic');

CSS files are placed in:

 app\webroot\css

I have searched on Google and have tried everything, I even uncommented the line:

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

But I still cannot get this to work. Please help me to resolve this issue.

4
  • its $this->Html->css('generic') for your 2.x version Commented Jul 8, 2013 at 18:43
  • sorry it was a mistake while pasting here ... Commented Jul 8, 2013 at 19:01
  • well i show you the directory ..there are many css files in there ... none of them is working .. if css file doesnt exist then why my web worked fine on localhost Commented Jul 8, 2013 at 19:44
  • Your .htaccess file is probably corrupt. Did you change something in there while migrating to the windows server? Commented Jul 8, 2013 at 21:03

1 Answer 1

5

Double check that you have all the .htaccess files in place. Also making sure /app/webroot/ has its .htaccess file:

<IfModule mod_rewrite.c>
   RewriteEngine On
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

Your request is trying to get the css file from /css/ but i'm thinking you don't have the proper .htaccess files in place to route it to the webroot and not to a controller!

also check if mod_rewrite is enabled

Edit: and then I saw the IIS part, you need some IIS equivalent to mod_rewrite

In this article you find all the information required for successfully run CakePHP web applications under Microsoft IIS web server: http://bakery.cakephp.org/articles/filippo.toso/2008/01/29/cakephp-on-iis

Here is a related question about getting cake to work on IIS: CakePHP 2.2.2 not working on Windows IIS7

Sign up to request clarification or add additional context in comments.

2 Comments

+1. Though you need to include the information in the answer, not reference it (a reference is supporting information). Also, there's no need to maintain an old version of your answer - an answer should be considered stateless.
thnx for the tips, I am still new to stackoverflow ;-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.