1

For us IIS URL Rewrite module is the way to go.

How can sitemanager maintain Urls and publish on demand?

Do we need to make an exception in cd deployer to publish it to disk?

Before DXA we published Rewrite.config to filesystem and used that file from web.config.
With DXA it can be created like this.

2

3 Answers 3

2

You can publish the rewrite.config to the broker and extend something like the URLRewrite.NET module to load the configuration from the database instead of the filesystem. The cool thing is that you can use it ahead of the DXA Static context module and before DXA starts processing the URLs.

One thing to consider is how you are loading the config from the broker since you could have many topology websites with multiple web applications hosted as a single website in IIS. Coming up with regex patterns for all of them and managing the configuration would be key to keeping the solution scalable.

A poor man's solution would to have a Razor template (or anything for that matter) publish a custom extension to the deployer. You can then configure your deployer to copy the custom extension to a filesystem instead of the broker database. You can include this in your IIS module for it to be picked up OOTB, This would still work but need to consider scaling among other considerations / configuration. Hope it helps!

1

Please refer to the link from the documentation link

If you still want to manage the redirection you can use the re-write module on IIS web config

2
  • For heavy load we prefer re-write module. Some pages during the day/week can be additional as described in document link. Sitemap content is available at <website>\sitemap.xml. Has anyone tried this path for "website>\rewrite.config" ? Maybe is not stable. Goal is still publish rewrite.config to disk. Commented Jan 24, 2021 at 21:35
  • Option can be to create JSON, read it and use it via a dictionary list. Don't know yet where that should be made available. Commented Jan 25, 2021 at 16:51
1

We have come across a legacy solution which was maintaining URL redirects and rewrites in a component and publish that as a config file to the file system (you need to configure .config extension in the storage config to publish this to the file system). Here is an issue with this approach:

  • The config file have it's limit (256 KB) as per Microsoft - so if you have couple of thousands of redirects and rewrites across your sites, then this won't work unless you hack some settings in the registry.
  • The solution is not long term considering publishing to the file system is on deprecated path.

So, while this is possible, I can confirm we are on a path to revamp this as a whole as the solution is not flexible/scalable (and becomes unsecured if you have to hack to support thousands of redirects/rewrites).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.