I have a requirement to extend tcdl linking so that it resolves links without index.html. So for example, I want /home/news/index.html to be resolved to /home/news/ This is Website App in 2013 using Java. It is not DXA or DD4T.

What's the best way to do this? By overriding TagRenderer class?


Just to share my idea, In the past, I did implement using the following approach, the files to be served without extension using .NET ASPX website, you can do similar in java also I think.

  1. Using Rewrite rule to remove the extension
  2. Add the extension back to the server
  3. Navigation XML published with URLs extensionless
  4. For the ComponentLinks - created custom TBB to processed component link field and a rich text field to be resolved on CMS side with custom ComponentLink control without tcdl tag, Webapp side handled custom component link control to be configured to process the URL links with extensionless.

In your case, you can extend tcdl link on the content service side or web app side to process the links based on will blog.

Rewrite rule:

<rule name="RemoveASPX" enabled="true" stopProcessing="true">
  <match url="(.*)\.aspx" />
  <action type="Redirect" url="{R:1}" />
<rule name="AddASPX" enabled="true">
  <match url=".*" negate="false" />
    <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
    <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
    <add input="{URL}" pattern="(.*)\.(.*)" negate="true" />
  <action type="Rewrite" url="{R:0}.aspx" />

Rewrite rule for java refer to this StackExchange answer.

I hope it helps.

| improve this answer | |

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.