I'm trying to build a rewrite rule. I cannot redirect because I need to preserve POST and GET data. In particular, if not present I need to add the string "v1". So:
http://www.example.com/ -> http://www.example.com/v1
I tried:
RewriteEngine On
RewriteRule "/(.*)$" "/v1/$1" [NC,L]
But this is not working. Can you help me please?
EDIT: with the first answer:
RewriteRule !^/?v1/ /v1%{REQUEST_URI} [NC,L]
http://www.example.com -> OK
http://www.example.com/v1 -> not preserving POST data (GET OK)
http://www.example.com/v1/ -> OK, please why (I just added a slash after v1, but this is not the solution I'm looking for)?