I need to do the following URL rewriting:
/.* -> /test/$1
How can I set it up with mod_rewrite
?
This is my full config:
<VirtualHost *:80>
ServerName main.domain
ServerAlias supplementary.domain
RewriteEngine on
RewriteCond %{HTTP_HOST} ^supplementary\.domain$
RewriteRule ^(.*)$ /supplementary$1 [NS] <-- doesn't work
<Location "/supplementary">
.. custom config ..
</Location>
</VirtualHost>
Try the following mod_rewrite config
Update:
If neither of Adrian Lang's examples work you could try something like this. The rewrite conditions will prevent it from doing further rewrites if the file exists.