Comments on: Storing URL rewrite mappings in a separate file https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/ Azure App Service Features and Best Practices Wed, 19 May 2021 03:09:34 +0000 hourly 1 https://wordpress.org/?v=6.2.16 By: Ruwantha https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-22823 Wed, 19 May 2021 03:09:34 +0000 http://ruslany.net/?p=760#comment-22823 In case if your rewrite.config file also tend to exceed the 250kb bench mark, is it possible to split rewrites to multiple configSource files?

]]>
By: Steve https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-22748 Thu, 13 May 2021 16:08:21 +0000 http://ruslany.net/?p=760#comment-22748 is there a work around for IIS 10? Not able to get rewritemaps to work.

]]>
By: Alo https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-811 Fri, 22 Dec 2017 14:12:35 +0000 http://ruslany.net/?p=760#comment-811 Hi,

To be able to use url rewrite mappings in an azure web app, do I need to enable “Enable proxy functionality in ARR” as stated in your following article:

http://ruslany.net/2014/05/using-azure-web-site-as-a-reverse-proxy/#more-48081

Or can I just add them to web.config without any additional configuration and expect it to work?

Thanks in advance.

]]>
By: Ruslan https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-810 Tue, 21 Nov 2017 19:15:23 +0000 http://ruslany.net/?p=760#comment-810 Hi Jono, unfortunately it is not possible to access and modify registry on the VM where Azure Web App runs.

]]>
By: Jono https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-809 Fri, 17 Nov 2017 09:33:06 +0000 http://ruslany.net/?p=760#comment-809 Hey Ruslan,

Wondering if you’ve encountered this issue within a Azure Web App filesystem, where you dont have access to the Registry to increase the rewriteRules.config max file size?

Cheers
Jono

]]>
By: Amit https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-808 Wed, 07 Dec 2016 21:28:36 +0000 http://ruslany.net/?p=760#comment-808 Hi,

Is it possible to break rewritemap.config file down in multiple files?
I am running into file size issue.

Config Error: Cannot read configuration file because it exceeds the maximum file size

Or have multiple files similar to rewritemap.config included in web.config?

Thanks in advance

]]>
By: Hiren https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-807 Wed, 06 Jul 2016 17:38:54 +0000 http://ruslany.net/?p=760#comment-807 hi ,

I have more than 10,000 old urls need to redirect what is best way ?

Website contains many products and each have different url like query string is changes

]]>
By: SJNBham https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-806 Wed, 18 Nov 2015 05:02:48 +0000 http://ruslany.net/?p=760#comment-806 The closing rewriteMaps tag needs a “/” I think. When I tried to use the code snippet, IIS Manger complained it was valid XML until I added it. Might want to update your sample code above.

]]>
By: John https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-805 Tue, 10 Nov 2015 19:42:20 +0000 http://ruslany.net/?p=760#comment-805 Hi, the post by Shilpa on 08 April 2015 is just what I need to do, giving me 500k of redirects in 2 files – any chance of seeing the sample code which has been left out? I can’t find anywhere else on the interweb offering any other solution for the 250k file size rewrite limit.

]]>
By: Shilpa https://ruslany.net/2010/05/storing-url-rewrite-mappings-in-a-separate-file/#comment-804 Wed, 08 Apr 2015 08:51:26 +0000 http://ruslany.net/?p=760#comment-804 Redirects can be split into 2 different files and then referenced into the web.config so that the web.config is not cluttered.

The rewritemaps.config can be used to write static redirects and the rewriterules.config can be used to add redirects that have any regex rules, although static redirects can also be added in the rules file. The rewritemaps redirects are then called from the rules file.

so in the web.config, the following needs to be added

Ensure both rewritemaps.config and rewriterules.config are in the same folder hosting the web.config
The rewrite maps will have entries as below

All rules within rewritemaps can then be called by a single rule in the rewriterules.config as below

This way you can have 2 files having redirects (so a total of 500kb at your disposal )

]]>