Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
its $this->Html->css('generic') for your 2.x version – Nunser Jul 8 at 18:43
sorry it was a mistake while pasting here ... – mynameisjohn Jul 8 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 – mynameisjohn Jul 8 at 19:44
Your .htaccess file is probably corrupt. Did you change something in there while migrating to the windows server? – Jelmer Jul 8 at 21:03

1 Answer

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

share|improve this answer
+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. – AD7six Jul 9 at 8:19
thnx for the tips, I am still new to stackoverflow ;-) – Alex Stallen Jul 9 at 8:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.