More in this section

URL Rewriting

2 posts, 0 answered
  1. Chris Wilper
    Chris Wilper avatar
    13 posts
    Registered:
    01 Sep 2009
    19 Oct 2009
    Link to this post
    I've created a page that dynamically loads content based on a query string value.  Can I dynamically generate the URL that is shown to the end user.  Example right now I navigate to the landing page for a location and I get the following url in sitefinity /home.aspx?location=Orlando.  I need the url to say "/Orlando-Landing-Page", basically the first part of the url is the qureystring value and the remaining is just a static value.  Can this be done?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    20 Oct 2009
    Link to this post
    Hi Chris Wilper,

    You can use Sitefinity's AdvancedUrlRewriter. Generally you need to rewrite the requested address and appending the query string. Note that the query string will not be visible from the url bar which means that you cannot get the query string using Request.QueryString.

    In your web.config file you can add runes as shown below:

    <urlrewrites>
      <!-- Add your rule elements here -->
      <rule>
        <url>/Orlando_Landing_Page\.aspx</url>
        <rewrite>/Orlando.aspx?location=Orlando</rewrite>
      </rule>
    </urlrewrites>

    The rewrited  url will be "/Orlando.aspx?location=Orlando?"

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
2 posts, 0 answered