htaccess的,mod_rewrite的,CakePHP的 [英] htaccess, mod_Rewrite, cakephp

查看:168
本文介绍了htaccess的,mod_rewrite的,CakePHP的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经被困了几个小时了这一点。我发现很多网上的资料,但没有就解决了我的问题。

I've been stuck for a few hours over this. I found lots of information online but nothing that solved my issue.

我托管在Dreamhost的有一个自定义的PHP安装(5.2.14)。 该网站会返回一个500内部服务器错误与此.htaccess文件。

I'm hosted on Dreamhost with a custom PHP installation (5.2.14). The site returns a 500 Internal Server Error with this .htaccess file.

它看起来像重写规则也适用于我的php.cgi文件,但我不知道如何避免这一点。

It looks like the rewrite rule is also applied to my php.cgi file but I don't know how to avoid that.

我的日志文件中显示,有是一个无限循环的地方请求超过了10内部重定向的限制,由于可能的配置错误。

My log file shows that there is an infinite loop somewhere "Request exceeded the limit of 10 internal redirects due to probable configuration error".

<IfModule mod_actions.c>
    Options +ExecCGI
    AddHandler php-cgi .php
    Action php-cgi /cgi-bin/php.cgi
    </IfModule>

    <FilesMatch "^php5?\.(ini|cgi)$">
    Order Deny,Allow
    Deny from All
    Allow from env=REDIRECT_STATUS
    </FilesMatch>

    RewriteEngine on
    RewriteBase /
    RewriteRule    ^$ app/webroot/    [L]   
    RewriteRule    (.*) app/webroot/$1 [L]

应用程序/ htaccess的:

app/.htaccess :

   RewriteEngine On
   RewriteBase /
   RewriteRule    ^$    webroot/    [L]    
   RewriteRule    (.*) webroot/$1    [L]

和应用程序/ Web根目录/的.htaccess

And app/webroot/.htaccess

    RewriteEngine On    
    RewriteBase /    
    RewriteCond %{REQUEST_FILENAME} !-d    
    RewriteCond %{REQUEST_FILENAME} !-f    
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

任何帮助将是AP preciated! 谢谢你。

Any help would be appreciated! Thanks.

推荐答案

我想它的可以的是你的CGI。尝试像这样?

I suppose it could be your cgi. Try something like this?

RewriteEngine on
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
RewriteRule    ^$ app/webroot/    [L]   
RewriteRule    (.*) app/webroot/$1 [L]

您还需要确保没有愚蠢的东西在你的应用程序/ webroot的事情/的.htaccess后都在这里可能会有所帮助。

You'll also want to make sure there isn't something goofy going on in your app/webroot/.htaccess It might be helpful to post both here.

这篇关于htaccess的,mod_rewrite的,CakePHP的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆