Is this resolved? I'm also not seeing my rules in IIS7's URL Rewriter 2.0 module having any effect. The <rewrites> section in web.config gets created/updated correctly via IIS, but then trying to type a link into the browser that should redirect based on that rewrite rule just creates a 404 page in Umbraco.
Here's what gets written as the rewrite rule; maybe I'm just not getting the rule right, but what should happen is users going to www.nwcouncil.org/energy/rtf/whatever (our Umbraco site) get redirected out of our Umbraco site and to another server as rtf.nwcouncil.org/whatever. Instead I just get a 404 error when input www.nwcouncil.org/energy/rtf/whatever
The url matching matches the URL after the hostname and slash, so instead of '<match url="http://www.nwcouncil.org/energy/rtf/*" />', you should use '<match url="energy/rtf/*" />'.
Also you're using the backreference {R:1}, but there's not capturing group. Therefor you should use regex, which will end up in this:
Is there any way to use a Rewrite instead of a Redirect? I am looking to rewrite a specific url of an umbraco site to a localhost for a store (IE www.example.com/store to localhost/store.) I've installed ARR 2.0 and set it up correctly using a non umbraco site, but am having trouble implementing it with the umbraco config. It seems to be picked up by the umbraco routing and displays a 404.
I know my rule is correct, because it works correctly as a redirect.
I'm having an issue with enabling "umbracoUseDirectoryUrls" in conjunction with the method above. My reverse proxy site uses a webservice at "/foo/searchService.asmx/Search". Even though I have "umbracoReservedPaths" set to "~/foo", it returns a 404. I know it's not making it past the the umbraco site as the 404 page is .net 4.0 specific.
I do not receive a 404 if "umbracoUseDirectoryUrls" is set to false.
I would just modify the url structure of the searchservice.asmx, but I would rather keep my reverse proxy site as close to out of the box as possible. I also am not sure if this happens with any other pages.
Is there anyway to make umbraco ignore "umbracoUseDirectoryUrls" for my ~/foo path?
Hmm, if it's the whole folder you want to add then you shoul probably use the <umbracoReservedPaths> setting instead - As you can see by default "Umbraco" and "Install has been added.
No matter what I try umbraco returns a 404 when I attempt to access it as "umbraco.domain/foo/searchService.asmx/Search". It works fine if I try to access "umbraco.domain/foo/searchService.asmx" or access "umbraco.domain/foo/searchService.asmx/Search" after changing web.config to
Is there any chance some sort of route is ignoring the <umbracoReservedPaths> node if there is a trailing slash on a .asmx? If so, is there a way to modify it and or delete/add with regex so it doesn't get picked up?
I should mention, our client is running on an older version, 4.11.
I found the function that I believe is causing the issue. It is located at UmbracoModule.cs:182 - function EnsureDocumentRequest. I may end up modifying this and recompiling it. I will update this thread if I do.
As for your issue Roger, it sounds like you're just looking for a redirect? I'm not that familiar with umbraco, but if you want all requests carumaethu.co.uk and www.carumaethu.co.uk to carumaethu.co.uk/cy - you could do that easily in IIS.
IIS7 url rewrite module
Hi,
My site uses sits in an IIS7 server and it uses the iis7 rewrite modul for our rewrites.
Umbraco uses its own rewrite modules, so my question is, can you use both?
Umbraco seems to intercept all requests so my iis7-rewrites are all bypassed.
best regards,
Ai
Yes you can use both.
The IIS rewrite rules will be executed before the umbraco rewrite rules in the 'request stack'
Is this resolved? I'm also not seeing my rules in IIS7's URL Rewriter 2.0 module having any effect. The <rewrites> section in web.config gets created/updated correctly via IIS, but then trying to type a link into the browser that should redirect based on that rewrite rule just creates a 404 page in Umbraco.
Here's what gets written as the rewrite rule; maybe I'm just not getting the rule right, but what should happen is users going to www.nwcouncil.org/energy/rtf/whatever (our Umbraco site) get redirected out of our Umbraco site and to another server as rtf.nwcouncil.org/whatever. Instead I just get a 404 error when input www.nwcouncil.org/energy/rtf/whatever
Or is it because of any of these other lines in web.config that are maybe preventing the IIS module from running?
Yes you're doing it wrong ;-)
The url matching matches the URL after the hostname and slash, so instead of '<match url="http://www.nwcouncil.org/energy/rtf/*" />', you should use '<match url="energy/rtf/*" />'.
Also you're using the backreference {R:1}, but there's not capturing group.
Therefor you should use regex, which will end up in this:
Or if you want to use the part after 'energy/rtf/', you should use this:
Lot's of information can be found here: http://www.iis.net/downloads/microsoft/url-rewrite
Also there's a way to kind-of debug the UrlRewrite module: http://blogs.iis.net/ruslany/archive/2008/10/30/debug-and-troubleshoot-rewrite-rules-easily.aspx
Is there any way to use a Rewrite instead of a Redirect? I am looking to rewrite a specific url of an umbraco site to a localhost for a store (IE www.example.com/store to localhost/store.) I've installed ARR 2.0 and set it up correctly using a non umbraco site, but am having trouble implementing it with the umbraco config. It seems to be picked up by the umbraco routing and displays a 404.
I know my rule is correct, because it works correctly as a redirect.
Is there any way to have umbraco not attempt to find these pages?
I may end up setting up a blank site otherwise and setting up rewrites for both.
Hi Michael and welcome to our :)
So if I get this right you have a store page, which should not be picked up by Umbraco because it has nothing to do with Umbraco?
Then you need to add it to the
<add key="umbracoReservedUrls" value="~/store" />
Hope this helps.
/Jan
AFAIK rewriting isn't possible to another domain...
Jan,
That worked. Thanks you are a life saver!
kipusoep,
It only works if you use the ARR module for IIS. You have to enable the proxy at the server level.
Hi Michael
Happy to hear that - If you add some point need to exclude a whole folder you can look at the umbracoReservedPaths key.
Have a nice evening.
/Jan
Jan,
I'm having an issue with enabling "umbracoUseDirectoryUrls" in conjunction with the method above. My reverse proxy site uses a webservice at "/foo/searchService.asmx/Search". Even though I have "umbracoReservedPaths" set to "~/foo", it returns a 404. I know it's not making it past the the umbraco site as the 404 page is .net 4.0 specific.
I do not receive a 404 if "umbracoUseDirectoryUrls" is set to false.
I would just modify the url structure of the searchservice.asmx, but I would rather keep my reverse proxy site as close to out of the box as possible. I also am not sure if this happens with any other pages.
Is there anyway to make umbraco ignore "umbracoUseDirectoryUrls" for my ~/foo path?
Hi Michael
Hmm, if it's the whole folder you want to add then you shoul probably use the
<umbracoReservedPaths>
setting instead - As you can see by default "Umbraco" and "Install has been added.Hope this helps.
/Jan
Jan,
I am using this. I have even tried to specify it.
No matter what I try umbraco returns a 404 when I attempt to access it as "umbraco.domain/foo/searchService.asmx/Search". It works fine if I try to access "umbraco.domain/foo/searchService.asmx" or access "umbraco.domain/foo/searchService.asmx/Search" after changing web.config to
It is definitely directly related to "umbracoUseDirectoryUrls" and the "/" at the end of "umbraco.domain/foo/searchService.asmx/"
Jan,
Is there any chance some sort of route is ignoring the
<umbracoReservedPaths>
node if there is a trailing slash on a .asmx? If so, is there a way to modify it and or delete/add with regex so it doesn't get picked up?I should mention, our client is running on an older version, 4.11.
Hi guys, im also having a rewrite issue if anyone can help me please?
I have a multilingual website with 2 cultures: /en (english) and /cy (welsh)
The main URL for the english version is lovefostering.co.uk and for the welsh version its carumaethu.co.uk
The client wants carumaethu.co.uk to hit the /cy to present the user with the correct language from the correct URL.
I have set up all the bindings in IIS with both domains and if I type in carumaethu.co.uk/cy it all works fine.
My issue is:
How do I send requests from carumaethu.co.uk and www.carumaethu.co.uk to carumaethu.co.uk/cy
Either in IIS or using Umbraco itself.
Many thanks in advance!
Just wanted to update my issue:
I found the function that I believe is causing the issue. It is located at UmbracoModule.cs:182 - function EnsureDocumentRequest. I may end up modifying this and recompiling it. I will update this thread if I do.
As for your issue Roger, it sounds like you're just looking for a redirect? I'm not that familiar with umbraco, but if you want all requests carumaethu.co.uk and www.carumaethu.co.uk to carumaethu.co.uk/cy - you could do that easily in IIS.
Something like this stackoverflow post should work.
I have the same issue, my rule works fine as redirect. But as a Rewrite it just returns 404.
I have tried adding the path to umbracoReservedUrls and to umbracoReservedPaths, but neither of these work.
I have tried the other solutions mentioned, but none seem to work.
Here's my rule.
Running IIS 7.5, ARR installed, Umbraco 7.0.4
is working on a reply...