首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >.cakephp的htaccess 属性?

.cakephp的htaccess 属性?
EN

Stack Overflow用户
提问于 2018-01-24 01:19:17
回答 2查看 0关注 0票数 0

正在尝试让一个CakePHP应用程序工作,其中包含以下内容:

代码语言:javascript
复制
app
cake
.htaccess
index.php
vendors

.htaccess文件包含以下内容:

代码语言:javascript
复制
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    /webroot/ [L]
    RewriteRule    (.*) /webroot/$1 [L]
</IfModule>

或者:

代码语言:javascript
复制
[Wed Aug 26 15:45:12 2009] [error] [client 10.7.10.52] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Wed Aug 26 15:45:12 2009] [debug] core.c(3063): [client 10.7.10.52] r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/webroot/webroot/webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/webroot/webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /webroot/js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] core.c(3069): [client 10.7.10.52] redirected from r->uri = /js/prototype.js
[Wed Aug 26 15:45:12 2009] [debug] mod_deflate.c(632): [client 10.7.10.52] Zlib: Compressed 649 to 405 : URL /webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/webroot/js/prototype.js
EN

回答 2

Stack Overflow用户

发布于 2018-01-24 09:30:05

.htaccess文件:

/var/www/app/webroot/。htaccess

代码语言:javascript
复制
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

/var/www/app/。htaccess

代码语言:javascript
复制
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$    webroot/    [L]
    RewriteRule    (.*) webroot/$1    [L]
</IfModule>

/var/www/。htaccess

代码语言:javascript
复制
<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^$ app/webroot/ [L]
    RewriteRule (.*) app/webroot/$1 [L]
</IfModule>
票数 0
EN

Stack Overflow用户

发布于 2018-01-24 11:00:30

.htaccess是默认的:

代码语言:javascript
复制
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteRule    ^$    webroot/    [L]
  RewriteRule    (.*) webroot/$1    [L]
</IfModule>

必须在“/etc/apache2/sites-enabled/default”中添加此内容:

代码语言:javascript
复制
<Directory /var/www>
  Options Indexes FollowSymLinks MultiViews
  AllowOverride All
  Order allow,deny
  allow from all
</Directory>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100007226

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档