1

I just uploaded a brand new copy of CakePHP 2.3 into a new domain-name, and right away it says "GET http://example.com/css/cake.generic.css 404 (Not Found)" in chrome. I don't understand why it is doing this. I have made other CakePHP websites and had this problem but I remember solving it accidentally, not knowing what I did. I would like to know exactly how to solve this problem, if anyone knows.

There is info out there about htaccess, mod_rewrite, and other things I don't understand. I don't know anything about where these files are, what they do, how to use them, etc.

Please help!

<IfModule mod_rewrite.c>  
RewriteEngine on
RewriteRule    ^$    webroot/    [L]
RewriteRule    (.*) webroot/$1    [L]
</IfModule>
11
  • Hey there; is there any way you could post part of your HTML output? (At least the part where you are trying to include your CSS files...) Commented Apr 16, 2013 at 5:30
  • It's completely just the standard layout file and just the front page which is controller=>pages action=>display, home. Commented Apr 16, 2013 at 5:44
  • The only change I made in the entire app was the cipher seed and salt in app/config/core Commented Apr 16, 2013 at 5:46
  • <link rel="stylesheet" type="text/css" href="/css/cake.generic.css"> Sorry 3 comments in a row Commented Apr 16, 2013 at 5:47
  • 1
    I can work on other websites for now...thanks for your help. For some reason, sometimes it works the first time, sometimes it takes some tinkering and I solve it accidentally and now it's just not working. Commented Apr 16, 2013 at 6:13

1 Answer 1

2

I figured it out...I had to create my own .htaccess file in the root folder. CakePHP only comes with 2 .htaccess files...one in the webroot and one in the /app folder but you also need one in the root folder. I found the answer from this question. .htaccess for cakephp

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

6 Comments

Incorrect, the default CakePHP package has 3 .htaccess files, you just missed copying one of them to your server. 1 2 3
If you say so...I just downloaded it straight from the website and made no changes to it and drag and dropped it to my server. Very strange.
It's not like I am making it up. Check the 1,2,3 links i have given in my previous comment to each .htaccess file which is included in the package. Many environments (most unix based systems) hide files starting with dot, that's why you must have missed the file on package root.
"I had to <make sure I didn't miss copying this file when uploading my site>"
Glad to hear that you found an answer!
|

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.