I try to redirect all requests from a domain to a subdomain, except for /mypath
and all stuff below.
Examples:
example.com -> sub.example.com
example.com/somestuff -> sub.example.com
but
example.com/my-path
should not be redirected.
Here's the configuration part responsible for that:
RewriteCond %{HTTP_HOST} ^example.com$
RewriteCond %{REQUEST_URI} !^/my-path/
RewriteRule ^/?(.*)$ "http\:\/\/sub\.example\.com" [R=301,L]
The problem is that I cannot achieve the goal and I have no idea what is wrong here. I have tried to find an example of that to achieve the same goal but no luck.