+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Dynamic 301 redirects

Dynamic 301 redirects

7 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    02 Oct 2012
    Link to this post
    Hi,

    Anyone who knows a good way to setup 301 redirects for dynamic generated items? I've read too much this evening I think to come up with something good.

    Thanks anyway,
    Daniel
  2. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    Registered:
    04 Jan 2016
    05 Oct 2012
    Link to this post
    Hello Daniel,

    Would it be possible to share some more details regarding the exact scenario you have in mind, please? 

    Regards,
    Atanas Valchev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Steve
    Steve avatar
    3037 posts
    Registered:
    03 Dec 2008
    05 Oct 2012
    Link to this post
    I need to do this too, and here's what I'm planning...

    1) Create a new custom field (long text) with the plain textarea box picked (not the radeditor), call it multipleUrls
    2) Copy the Title\ExampleText from the page properties UI :)

    Then in an HttpModule do a search for matches, and then redirect to the detail view of the appropriate item.  What's undecided for me is if I'll use the API or some custom SP to boost speed (assuming there's any noticeable difference)

    ...essentially copy what the page properties does.  The reason I like this is because I should be able to add a custom sidebar filter to show me content items that have or do not have this field filled out.

    I do wish this was somehow native though...
  4. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    09 Oct 2012
    Link to this post
    Well, I have the following situation:

    Legacy site
    There is a product section which has these kind of urls:
    http://www.website.com/products/product-detail.aspx?product_id=1100

    New site
    On the new site a product page looks like this:
    http://www.newwebsite.com/products/detail?pid=1100

    So, no page extension and another ID inside the url parameters. The product ID is the same.
    I'm not familiar with writing these HttpModules and Url Rewrite rules that make use of RegEx.

    Daniel

  5. MB
    MB avatar
    302 posts
    Registered:
    09 Jan 2005
    09 Oct 2012
    Link to this post
    Does the new site need to redirect to the old site, or just support the legacy URL format?
  6. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    09 Oct 2012 in reply to MB
    Link to this post
    Hi MB,

    No it just needs to support the legacy urls.

    ---
    Daniel
  7. MB
    MB avatar
    302 posts
    Registered:
    09 Jan 2005
    09 Oct 2012 in reply to Daniel Plomp
    Link to this post
    I think that can be done fairly easily using the IIS URL Re-Write module.

    http://www.iis.net/downloads/microsoft/url-rewrite

    Basically, you want a rule something like this: (paste into the <system.webserver> section of web.config, once you have installed the IIS URL ReWrite module)

    <rewrite>
    <rules>
    <clear />
    <rule name="ReDirect Old Product URLs">
    <match url="^products/product-detail\.aspx\?product_id=([0-9a-z-_]+)$" />
    <conditions logicalGrouping="MatchAll" trackAllCaptures="false" />
    <action type="Redirect" url="products/detail?pid={R:1}" />
    </rule>
    </rules>
    </rewrite>

    Note: This is quite specific, and you might need to adjust it to suit your needs, but there is a pattern-match tester built into the re-write module so that you can play with it.

    Essentially, it's looking for your old URL format (the protocol and host is ignored) and saving the bit after the ?product_id=

    It then redirects to the new URL using the saved item as part of the new URL.

    HTH.
7 posts, 0 answered