Index page showing without css and js

60 Views Asked by At

I am new in cakephp (using 2.8.0 verison),I uploaded backup of site then index page showing without css and js. After press "ctrl + U " , Showing missing "Js controller" and "Css controller" not found

Here is my code in .htaccess file in webroot folder

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

Is there any other way for fix this ? How can i fix this issue.

1

There are 1 best solutions below

2
J. Knabenschuh On

Following could work implied your css and js have its own subfolder (not tested)

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

see https://serverfault.com/questions/410445/excluding-a-directory-from-a-root-htaccess-rewrite-rule-to-allow-it-to-be-passw