Reputation: 473
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');
?>
Upvotes: 3
Views: 4856
Reputation: 1
Please delete all the .htaccess file and enable the :
Configure::write('App.baseUrl', env('SCRIPT_NAME'));
in app/config/core.php. its working fine.
Upvotes: 0
Reputation: 311
Regarding CSS
and JS
load issue, please verify mod_rewrite
is enabled on your server or not.
Upvotes: 1
Reputation: 473
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.
Upvotes: 5
Reputation: 8540
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>
Upvotes: 1