After a2enmod rewrite
, I wrote the file /etc/apache2/conf-available/myspecific_rewrite.conf
:
RewriteEngine on
RewriteRule ^/test(/.*)?$ http://anothersite.tld/test$1 [R]
RewriteRule ^/test2(/.*)?$ http://anothersite2.tld/test [R]
Then I a2enconf myspecific_rewrite
and the correct symbolic link is created in /etc/apache2/conf-enabled
.
The problem is that this conf doesn't work : the rewrite is not active.
I want that rewrite to be active for all my virtual hosts. This file I wrote defines RewriteRule
s outside of a <VirtualHost>
... is there a way to make it working?