it works if my .htaccess is
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^petizioni/(.*)$ http://localhost/modules/xpetitions/$1 [QSA,L]
Update:
My mistake, I don't have updated these two lines
$_SERVER['REQUEST_URI'] = str_replace( $value , 'modules/'.$key , @$_SERVER['REQUEST_URI'] ) ;
$_SERVER['HTTP_REFERER'] = str_replace( $value , 'modules/'.$key , @$_SERVER['HTTP_REFERER'] ) ;