How to make URL for each tab in a page in sitecore 7.0?

50 views Asked by At

I have an application on sitecore 7.0.

I have a sitecore item named as Item1. That item's view has 3 tab mainly Home, about and contact. The URL for the item is /en/Home/Item1. On page load, Home section renders by default. so, i want the URL by default to be /en/Home/Item1/home. When the user clicks about tab, the page remains same but URL changes to /en/Home/Item1/about. The problem is that the URL /en/Home/Item1/home itself doesn't exist, so how do i allow Sitecore to just read the URL as /en/Home/Item1 and ignore everything that is after it or consider it as an argument.

Refer to this image to get the idea of design of the page

1

There are 1 answers

0
pblrok On

Use ISS rewrite rules

Final result will look something like this

<rewrite>
  <rules>
    <rule name="Rewrite to home">
      <match url="^en/Home/Item1/home" />
      <action type="Rewrite" url="/en/Home/Item1?tab=home" />
    </rule>
  </rules>
</rewrite>

or like this

<rewrite>
  <rules>
    <rule name="Rewrite Item1">
       <match url="^en/Home/Item1/([_0-9a-z-]+)" />
       <action type="Rewrite" url="/en/Home/Item1?tab={R:1}" />
    </rule>
  </rules>
</rewrite>

dependant what you want to do after