I have been working on a CakePHP App, most of the CSS / JS / images (icons) are located in the webroot directory (/var/www/app/webroot/), but for some portion (Croogo) or other pages of the app, I need to load CSS / JS / images from a different directory i.e /var/www/app/views/themed/admin/webroot/.
Now the issue I am facing is that when I render these other pages the css / JS / images requests return 404 page not found status, as these requests are made to main webroot rather than the different directory i mentioned above.
Is there a way to handle this with .htaccess, i.e if the url contains this pattern "/admin/"
Example:
The CSS / JS / img files should be looked up into /var/www/app/views/themed/admin/webroot/ rather than var/www/app/webroot/ ??
If not is there any other workaround to handle such a scenario?
Following is the .htaccess of main app directory
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
Following is the .htaccess of main webroot directory
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
CakePHP code
echo $html->link($html- >image('../theme/admin/img/icons/16/icon16x16.png',array('alt'=>'','class'=>'icon left','id'=>'profile-icon')).'Resize',array('action'=>'edit_photo','01'),array('escape'=>false,'id'=>'profile-photo','class'=>'blue','rel'=>'shadowbox;height=100;width=400','title'=>'Resize'));
Generated HTML
<a href="/edit_photo/01" id="profile-photo" class="blue" rel="shadowbox;height=100;width=400" title="Resize"><img src="/theme/admin/img/icons/16/icon16x16.png?v=1000" alt="" class="icon left" id="profile-icon" />Resize</a></div>
CakePHP version 1.3
Any thoughts and ideas would be appreciated!