开发者

set_exception_handler() works 2 times with mod_rewrite

开发者 https://www.devze.com 2023-03-30 23:47 出处:网络
I have the next simple logging code: function log($exception) { error_log($exception->getMessage() . \"\\n\", 3, \'error.log\');

I have the next simple logging code:

function log($exception) {
    error_log($exception->getMessage() . "\n", 3, 'error.log');
}
set_exception_handler('log');
throw new Exception('Holy cow!');

And I need to make all requests go to index.php. So my .htaccess file is next:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]

And for this situation I have 2 records in log file. But when I remove Rewrite conditions, just 1 record i开发者_StackOverflow社区nserts.

How can I avoid of inserting 2 same records? Sorry for my english.


Try to put a favicon.ico in your web root.

0

精彩评论

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