Thanks it worked !
I add more info cause it was in https, so the rewrite rule was returning an 500 error due to ssl proxy disabled
I had to add SSLProxyEngine On
in the virtual host to have this answer fully work in https
i also noticed it has to be put in the virtual host desired, if it is added in global conf this parameters will not be shared:
example:
this works
<VirtualHost *:443>
ServerName example.domaine.com
DocumentRoot /var/www/example/
SSLProxyEngine On
RewriteCond %{HTTP_USER_AGENT} ^-?$
RewriteCond %{REQUEST_URI} !errors\/noua\.htm
RewriteRule (.*) /errors/noua.htm [P]
...
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
...
</VirtualHost>
this wont works
<VirtualHost *:443>
ServerName example.domaine.com
DocumentRoot /var/www/example/
RewriteCond %{HTTP_USER_AGENT} ^-?$
RewriteCond %{REQUEST_URI} !errors\/noua\.htm
RewriteRule (.*) /errors/noua.htm [P]
...
</VirtualHost>
<VirtualHost *:443>
SSLEngine on
SSLProxyEngine On
...
</VirtualHost>