I have multiple domains running, on the same Umbraco installation. On one of the sites I am using url rewriting specified in UrlRewriting.config. My problem is that the following statement works on all domains. I would like the rewriting only to take place on a specific domain, but if I change ~ to my specific domain the routing is not working.
Unfortunate that solution don't work. Because the UrlRewriting skips the host if redirect is set to anything other than domain. This is also expected when your working with one website. The problem is that we sometimes in Umbraco has multiple sites, on the same installation (same physical location).
I actually solved it by writing my own Rewrite-Rule-Provider and extended it with a "domain" property. In the overridden RewriteUrl method I compare the request and if the host is NOT the same as the one defined in the UrlRewriting.config I just redirect the Url otherwise I redirect as described in the "virtualUrl"
If anyone would like the complete solution I can post it here?
UrlRewriting.config
I have multiple domains running, on the same Umbraco installation. On one of the sites I am using url rewriting specified in UrlRewriting.config. My problem is that the following statement works on all domains. I would like the rewriting only to take place on a specific domain, but if I change ~ to my specific domain the routing is not working.
This example takes all domains:
But I need to ensure, I only get routing on my subdomain: test.mysite.dev/
Does anyone know, how I setup the rule to only apply on my subdomain?
Hi Dennis,
Can you try like :
Thanks
Hi Alex,
Unfortunate that solution don't work. Because the UrlRewriting skips the host if redirect is set to anything other than domain. This is also expected when your working with one website. The problem is that we sometimes in Umbraco has multiple sites, on the same installation (same physical location).
I actually solved it by writing my own Rewrite-Rule-Provider and extended it with a "domain" property. In the overridden RewriteUrl method I compare the request and if the host is NOT the same as the one defined in the UrlRewriting.config I just redirect the Url otherwise I redirect as described in the "virtualUrl"
If anyone would like the complete solution I can post it here?
is working on a reply...