Now I learned that it can be done by editting the .htaccess, the issue here is that if add "php_flag display_errors off" I get Internal Server Error (500).
This is my .htaccess
DirectoryIndex index.php
RewriteEngine On
#RewriteBase /your-sub-directory
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]