I just configured cakePHP 2.0 on my server but the default page has no layout and css applied. It also displays the following error.
URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting
I already found out that the no-layout/css issue is probably related to the URL Rewriting error so I followed the steps described at this Cookbook page but it does not have any effect. The URL rewrite error is still visible and the default page still misses its layout and css styles.
Some info
- Display errors in php.ini is on
- The css and favicon.ico included in the html head give an 404
- Both files are in webroot folder
- Location of webroot folder is /admin/app/webroot/
- phpinfo() says mod_rewrite module is loaded
-
Folder structure is as follows:
- html (apache root folder)
- admin
- app
- ...
- webroot
- css
- cake.generic.css
- css
- ...
- cake
- lib
- ...
- app
- admin
- html (apache root folder)
[error] [client 212.***.***.***] File does not exist: /var/www/html/admin/css, referer: http://***.nl/admin/
[error] [client 212.***.***.***] File does not exist: /var/www/html/admin/img, referer: http://***.nl/admin/
[error] [client 212.***.***.***] File does not exist: /var/www/html/admin/favicon.ico
Contents of /admin/app/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /admin/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
Contents of /admin/app/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /admin/
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>