Cake site not finding images nor CSS files after moving it to my localhost?
cakephp, cakephp-1.3
Solution
Cake directs all its call to webroot folder (by default called URL rewriting). This is achieved via .htaccess file in the document root, which MUST have (for URL rewriting to work)
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
The .htaccess file inside the webroot folder should contain
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d // this line traps requests for directory
RewriteCond %{REQUEST_FILENAME} !-f // this line traps requests for file names
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]
</IfModule>
The two lines `RewriteCond %{REQUEST_FILENAME} !-d` & `RewriteCond %{REQUEST_FILENAME} !-f` are essential in parsing requests for directories and file names.
The line `RewriteRule ^(.*)$ index.php?/$1 [QSA,L]` deals with anything which is not a file or directory.
- Check if mod_rewrite is enabled or not.
- There must be two .htaccess file, one in the root folder and other one in the webroot folder. The contents of both these .htaccess files must be different.
You may wanna check out URL rewriting
You can turn off URL rewriting from Core Configuration
Problem
I'm using cake1.3.5 I recently moved a live working site into my localhost: I set config.php to my local database but when I enter the site, I see this: Is it there any additional step I am missing (concerning the file path or something)?