【问题标题】:Cake PHP issues on startCake PHP 启动时出现问题
【发布时间】: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


【解决方案1】:

你应该在你的 Apache 配置中启用 mod_rewrite,你可以在这里找到更多,http://book.cakephp.org/2.0/en/development/routing.html

如果您需要在app/config/core.php 第 84 行,您也可以关闭此功能对 mod_rewrite 的需要

【讨论】:

    猜你喜欢
    • 2016-11-20
    • 2018-07-31
    • 1970-01-01
    • 2019-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多