开发者

CakePHP .htaccess breaking access to apache logs

I've read Cakes section on Apache but it doesn't cover my question.

Here's my .htaccess:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule    ^$ /app/webroot/    [L]
    RewriteRu开发者_如何学Pythonle    (.*) /app/webroot/$1 [L]
</IfModule>

(I've had to add the leading / to make the paths absolute, to make it work on my live server, but I don't think that's causing my problem).

I use a resellers account to host my site, and one of the features built in to the Control Panel is the ability to quickly read recent apache access logs. The CP installs a CGI script to dump the last ~100 lines from the logs in to the browser for convenience.

However, my .htaccess is rewriting all requests, and so the CGI script is failing to execute, and the logs aren't processed. If I remove the .htaccess, I can execute the CGI and view logs as normal.

My host confirmed this was the cause, but would not elaborate any further due to it being 3rd party code etc.

Are there any changes I can make to my .htaccess to allow the CGI scripts to execute I correctly, and provide access to my logs (which are stored above public_html).

I have tried RewriteRule ^(.cgi) - [L] to ignore cgi files but it doesn't appear to work.

Thanks for any insight.


If you want to ignore files with the extension "cgi" you would use:

RewriteRule ^.*\.cgi$ - [L]

. is a wildcard in regular expressions.

Note: This rule has to appear before the "Everything" (.*) wildcard rule.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜