Vanity url is not working with rewrite rule
We are trying to make the vanity url works on both publish and dispatcher servers. Download and installed the VanityURLS-Components package and followed all the steps that documented.
The vanity url is working only when we delete or comment the below rewrite rule
RewriteCond %{REQUEST_URI} !^/apps
RewriteCond %{REQUEST_URI} !^/bin
RewriteCond %{REQUEST_URI} !^/content
RewriteCond %{REQUEST_URI} !^/etc
RewriteCond %{REQUEST_URI} !^/home
RewriteCond %{REQUEST_URI} !^/libs
RewriteCond %{REQUEST_URI} !^/tmp
RewriteCond %{REQUEST_URI} !^/var
#RewriteRule ^/(.*)$ /content/myproject/$1 [PT,L]
But the above commented rewrite rule is required to allow only /content path. Dispatcher filter will reject any request that is not started with /content. With that even etc sling mapping also could not help because the request is not blocked at dispatcher level and not reached publish server.
Is there any other way to handle this without removing rewrite rule?