0

What would be the best way to handle the Dynamic URLs in Sitecore 9.1? For example,

I have a Blog page and Blog details page. Blog page will have multiple blog details. When user is clicking on any of the blog details, it will be redirected to blog details page with a querystring. Based on querystring value I am currently showing the content on the details page. But now I have a requirement to handle friendly URL instead of appending as a querystring.

www.myblog.com/blog/details?id='abcd' should now be changed to www.myblog.com/blog/details/abcd

  1. I am using Sitecore 9.1.1
  2. Neither SXA nor SXC
  3. It is a conventional Sitecore site.

Please let me know how to handle the requirement. Is there any wild card module exists out of the box for this?

3
1

There is a wildcard module available in Sitecore marketplace which can exactly help you in your blog post with blog detail scenario.

Module's marketplace link : https://marketplace.sitecore.net/en/Modules/Wildcard_module.aspx

There is also an excellent demo (youtube video) of this module by Adam Conn : http://www.youtube.com/watch?v=ckbfIs9iqMY

This module has also worked in Sitecore 9 update 2 as well. For more information about this, please check the below informative link that I shared in the comments - https://codeandlearnspot.wordpress.com/2019/02/02/wildcard-module-revisited/

4
0

You can use the url rewrite module to do this. https://marketplace.sitecore.net/Modules/Url_Rewrite.aspx (GitHub link for v1.9 which is Sitecore 9 compatible: https://github.com/davvves/UrlRewrite/tree/sc9update)

The Sitecore Package for v1.9 for Sitecore 9 can be found here

I wrote a blog post ok how you can mask a url here: http://www.flux-digital.com/blog/tips-on-installing-and-using-the-sitecore-url-rewrite-module/

Essentially you:

  • add an inbound rule to match a url pattern using regex
  • add a rewrite rule to rewrite the url to a new url

I’ve used this successfully on a number of projects in the past

4
0

There is no need to install any sitecore module to accomplish this, you could just use an IIS rewrite rule that will handle the rewrite for your blog url like this:

<rule name="Blog URL Rewrite" stopProcessing="true">
   <match url="^blog/details?id=([_0-9a-z-]+)$" />
   <action type="Rewrite" url="/blog/details/{R:1}" appendQueryString="true" />
</rule>

If you have links on the pages aswell you might need to create an outbound rule for the /blog/details/([0-9]+)$ urls by reverting the logic to handle the formatted url. You can take a look at some examples https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/creating-outbound-rules-for-url-rewrite-module

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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