0

Am working with cakePHP. And i installed and configured everything. And Am using the virtual host also. When i call the base url, i get all the css and js files loaded. but when i included the method name in the url, it shows not found. I think it is due to some url rewriting problem. My project directory is /var/www/html/Betting/ My .htaccess (/var/www/html/Betting/.htaccess)

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^$ app/webroot/ [L]
    RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

And (/var/www/html/Betting/app/.htaccess) is

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

And (/var/www/html/Betting/app/webroot/.htaccess) is

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

If I call the URL http://betting.spark.com/site everything is fine. But i call http://betting.spark.com/site/index it is not loading the css and js files. Any help would be appreciated. :)

1 Answer 1

1

How do you link css file and js file? If you place css and js file as cakephp style. you can link Html and Css file like this. js file are under webroot/js and css file are under webroot/css

<?= $this->Html->css(['bootstrap.css','bootstrap-theme.min.css']) ?>
<?= $this->Html->script(['jquery-2.0.3.min.js','bootstrap.js']); ?>
Sign up to request clarification or add additional context in comments.

Comments

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.