The mistake is putting the
rewrite rules into an .htaccess file instead of the main configuration file. The .htaccess setup is a leftover from a kind of shared hosting common in the mid to late 1990s and usually not relevant these days. Put your rewrite rules in the main configuration file, which will likely be somewhere under /etc/apache2/sites-available/
Then the following will deploy the changes, assuming there are no syntax errors:
Code:
apache2ctl configtest && apache2ctl graceful
However, even without syntax errors the rules may still need some revision to do what you actually want them to do.
As for the debugging of the rules, is /var/www/html/test/ a directory or is /var/www/html/test a file?