【发布时间】:2012-06-30 03:56:47
【问题描述】:
我在 webroot 文件夹中有 css 和 js,但都没有加载...
firebug 报错
"NetworkError: 500 Internal Server Error - http://localhost/cakephp/"
"NetworkError: 404 Not Found - http://localhost/cakephp/css/common.css"
"NetworkError: 404 Not Found - http://localhost/cakephp/js/common.js"
我的基本文件夹是 cakephp。但是页面(http://localhost/cakephp/)中显示的一些内容没有样式。内容来自数据库。
主重定向链接也不起作用...
在此服务器上找不到请求的 URL /cakephp/videos/list。
只有主页显示内容...
布局页面
echo $this->Html->css('common');
echo $this->Html->css('dialog');
echo $this->Html->script('jquery.min');
echo $this->Html->script('common');
.htaccess
# compress text, html, javascript, css, xml:
SetOutputFilter DEFLATE
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
app/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>
app/webroot/.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>
【问题讨论】:
-
如果您使用的是 apache,您是否尝试过在 apache 设置文件 (httpd.conf) 中启用 mod_rewrite?
-
@VishalDeep:谢谢,它有效...
标签: cakephp cakephp-1.3