UrlRewriting to another domain - error 'not a valid virtual path'
I'm trying to rewrite a path on a website to load another domain - is this possible? Using the config setting below I'm getting the this error: Exception message: 'http://otherdomain.com' is not a valid virtual path.
I think you may need the http://firstdomain.com in you virtualUrl as well, seen as you've specified rewrite="Domain" might you also need the trailing slash on the destinationurl?
I've tried adding the domain to the virtual url, as well as adding the trailing slash to the destination url, but everything I've tried still ends in the same error. I've now setup a subdomain to use but it still isn't working. Eg:
The documentation doesn't give me any more info either. Has anybody successfully used rewrite="Domain"? All of the examples that I've seen use redirect="Domain".
After some researching I've come to the conclusion that this won't work with the Umbraco Url Rewriting module. The problem is that it uses HttpContext.Current.RewritePath, and this requires a valid virtual path which can't contain a full URL, I think it has to be a relative URL. So I've now purchased ISAPI_Rewrite ( http://www.helicontech.com/isapi_rewrite/ ) which has a proxy setting that rewrites to other domains and works perfectly.
UrlRewriting to another domain - error 'not a valid virtual path'
I'm trying to rewrite a path on a website to load another domain - is this possible? Using the config setting below I'm getting the this error: Exception message: 'http://otherdomain.com' is not a valid virtual path.
Here's the UrlRewriting.config setting:
<add name="compare" virtualUrl="^~/path/here" rewrite="Domain"
destinationUrl="http://otherdomain.com" ignoreCase="true" />
Any help would be greatly appreciated, thanks.
http://our.umbraco.org/forum/developers/extending-umbraco/2600-Using-UrlRewriting-to-redirect-domain similar scenario but a redirect not a rewrite as you require.
also has a link to the documentation www.urlrewriting.net/160/en/documentation.html :-)
I think you may need the http://firstdomain.com in you virtualUrl as well, seen as you've specified rewrite="Domain" might you also need the trailing slash on the destinationurl?
Hi Mike,
I've tried adding the domain to the virtual url, as well as adding the trailing slash to the destination url, but everything I've tried still ends in the same error. I've now setup a subdomain to use but it still isn't working. Eg:
<add name="compare" virtualUrl="http://www.domain.com/directory/?$" rewrite="Domain"
destinationUrl="http://subdomain.domain.com" ignoreCase="true" />
The documentation doesn't give me any more info either. Has anybody successfully used rewrite="Domain"? All of the examples that I've seen use redirect="Domain".
I'm wondering if you can rewrite between domains? Maybe this is disallowed to stop phishing, so for your needs you would have to change to a redirect?
After some researching I've come to the conclusion that this won't work with the Umbraco Url Rewriting module. The problem is that it uses HttpContext.Current.RewritePath, and this requires a valid virtual path which can't contain a full URL, I think it has to be a relative URL. So I've now purchased ISAPI_Rewrite ( http://www.helicontech.com/isapi_rewrite/ ) which has a proxy setting that rewrites to other domains and works perfectly.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.