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

Forums / General Discussions / 301 redirect a generated page

301 redirect a generated page

7 posts, 0 answered
  1. Steve
    Steve avatar
    5 posts
    Registered:
    20 Jul 2011
    20 Jul 2011
    Link to this post
    I am trying to redirect a particular page to another, however the page that needs to be redirected does not actually exist in the 'Pages' section of the sitefinity backend because it is a page generated from a template based on certain queries.

    Let me give you an example. 

    (1) Generated page: http://www.stubnut.com/taylor-swift-tickets.aspx

    (2) Actual page in backend: http://www.stubnut.com/Concerts/Concert-Tickets/Taylor-Swift.aspx

    I need to redirect (1) to (2) in a search engine friendly way. The unfortunate thing is that most of the documentation I have found here to do redirects require you to place an element on the page being redirected. This has no application in my situation as the page cannot be edited because it is generated from a template. And if I were to add the code to the template, ALL of my pages (there are thousands) that are generated from that template would redirect to (2).

    All help is greatly appreciated.
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    07 Jun 2017
    21 Jul 2011
    Link to this post
    Hi Steve,

    Please take a look at the attached simple user control which sets the proper redirect code 301 permanent redirect to suit the SEO standards, and allows you to redirect to any link specified in the RedirectString property of the control.Add it to your project from Visual Studio and build the project. Then you register it in Sitefinity (for more inforamtion, please visit this article from our Documentation ) and drop it on any page. Click the Edit button and set the RedirectString property to any page you want your current page to redirect you. The page is still editable in Sitefinity, but if requested directly it will automatically redirect the user to the destination set in the RedirectString property.

    Regards,
    Boyan Barnev
    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
    5 posts
    Registered:
    20 Jul 2011
    21 Jul 2011
    Link to this post
    Unfortunately, this will not work in my instance:

    "and drop it on any page. Click the Edit button and set the RedirectString property to any page you want your current page to redirect you."

    The page that I need to redirect to is not a static page. It is dynamically generated when HTTP get calls the url. The only editable part of this page is the Template. But if I put this in my template then all of the thousands of pages that are generated would redirect and that, obviously, is unacceptable.

    Maybe I am misunderstanding something.

    The best solution I see would be one analogous to .htaccess redirects where one can specify a source and redirect url. Is something like this possible?
  4. Steve
    Steve avatar
    5 posts
    Registered:
    20 Jul 2011
    25 Jul 2011
    Link to this post
    Is there a solution that could be implemented using IIS ?
  5. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    07 Jun 2017
    28 Jul 2011
    Link to this post
    Hi Steve,

    I understand now, thank you for the clarification. Can you please let us know of the exact use case scenario you're trying to implement here, by using these automatically generated pages that redirect to the actual pages in your project? It looks like you're trying to create a more user-friendly URLs in a way (like URL shortening). If that's the case, time I'd suggest using some 3rd party url rewiting tool like http://www.urlrewriting.net/.

    Best wishes,
    Boyan Barnev
    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
  6. Steve
    Steve avatar
    5 posts
    Registered:
    20 Jul 2011
    28 Jul 2011
    Link to this post
    Please browse each of these links:

    (1) Generated page: http://www.stubnut.com/taylor-swift-tickets.aspx

    (2) Actual page in backend: http://www.stubnut.com/Concerts/Concert-Tickets/Taylor-Swift.aspx

    As you can see they are completely different pages. What I would like is for the link in (1) to redirect to (2). 

    Thanks.
  7. Steve
    Steve avatar
    5 posts
    Registered:
    20 Jul 2011
    08 Aug 2011
    Link to this post
    Awaiting feedback. Thanks
7 posts, 0 answered