301 redirect a generated page

Posted by Community Admin on 03-Aug-2018 20:17

301 redirect a generated page

All Replies

Posted by Community Admin on 20-Jul-2011 00:00

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.

Posted by Community Admin on 21-Jul-2011 00:00

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

Posted by Community Admin on 21-Jul-2011 00:00

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?

Posted by Community Admin on 25-Jul-2011 00:00

Is there a solution that could be implemented using IIS ?

Posted by Community Admin on 28-Jul-2011 00:00

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

Posted by Community Admin on 28-Jul-2011 00:00

Please browse each of these links:

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

(2) Actual page in backend: www.stubnut.com/.../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.

Posted by Community Admin on 08-Aug-2011 00:00

Awaiting feedback. Thanks

This thread is closed