3

I just uploaded my website to the server but is not loading the css and js files, only I can see the site just like text and after put the .htaccess files in their places I got this message in the site:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

These are my .htaccess files

/www/

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

/www/app/

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

/www/app/webroot/

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

some idea why is not working? I hope you can help me, thank you.

<?php

    echo $this->Html->css('bootstrap');
    echo $this->Html->css('styles');

    echo $this->Html->script('jquery');
    echo $this->Html->script('bootstrap.min');

    echo $this->fetch('meta');
    echo $this->fetch('css');
    echo $this->fetch('script');

?>
3
  • Could you show the code you have for outputting the CSS/JS in your View templates? Commented May 29, 2015 at 20:41
  • @drmonkeyninja that is the code but I think the problem is about the configuration of some files like the .htaccess or something else, I added RewriteBase / to the .htaccess files and the "500 Internal Server Error" dissappeared and now the site is just empty Commented May 29, 2015 at 20:56
  • You will also need RewriteBase /webroot in the .htaccess inside webroot. Also make sure debug mode is enabled in your cake app so you see errors. Commented May 30, 2015 at 16:16

4 Answers 4

5

I solved my problem, the solution is firstly (in my case) delete the three .htaccess files and edit this line in app/config/core.php

//Configure::write('App.baseUrl', env('SCRIPT_NAME'));

to this:

Configure::write('App.baseUrl', env('SCRIPT_NAME'));

it works for me, thanks guys anyway.

Sign up to request clarification or add additional context in comments.

1 Comment

Also worked For me in same pattern , I am using Cakephp 2.7.9 Sheared hosting (cpanel based )
1

I'm guessing that none of your 'clean' urls are working, not just your CSS/JS files. So firstly, check that mod_rewrite is enabled on the server. You can do this by checking it's listed as one of the enabled modules using phpinfo().

If it is enabled you probably want to check that your virtual host is configured correctly. You should have AllowOverride All in your vhost's conf file, something like this:-

<VirtualHost *:80>
    ...
    <Directory "/var/www/vhosts/example.com">
        AllowOverride All
    </Directory>
</VirtualHost>

2 Comments

There is nothing related with "mod_rewrite" using phpinfo() and this server has no a vhost file.
Look this is the url www.genebi.net
1

Regarding CSS and JS load issue, please verify mod_rewrite is enabled on your server or not.

6 Comments

How i can verify that in the live server?
upload one test file and write echo phpinfo(); and run that file and find mode_rewrite keyword if its there then your mode_rewrite is on otherwise contact to your hosting provider they will check and if its not on then they on it
No, there is no the keyword "mode_rewrite" or something related with it
You can see here www.genebi.net
This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post.
|
0

Please delete all the .htaccess file and enable the :

Configure::write('App.baseUrl', env('SCRIPT_NAME'));

in app/config/core.php. its working fine.

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.