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

Forums / Developing with Sitefinity / Prevent Localization for non Sitefinty pages

Prevent Localization for non Sitefinty pages

12 posts, 0 answered
  1. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    30 Oct 2009
    Link to this post
    Hi there

    I run a site that has part beeing build in asp.net with telerik tools static text is html which the client still updates using Frontpage.

    Now I started with the Sitefinty implementation to get the whole site CMS based.

    The problem is that I use localization with pathprefix.

    BIG PROBLEM

    Whenever I try to access a old .aspx page (that runs outside of sitefinity) I am redirected to /en/thatpage.aspx or /de/thatpage.aspx.

    QUESTION

    How to I prevent .aspx pages to be handled by Sitefinity?

    Regards Markus
  2. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    30 Oct 2009
    Link to this post
    It seems updating to 3.7 SP1 solved the problem mostly.

    There are still /en/ or /de/ added to the url but at least it seems to be working.

    I rather would have sitefinty leave the urls of 'physical' asp.net pages alone

    Regards Markus


  3. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Oct 2009
    Link to this post
    Hello Markus Berchtold,

    If you want to remove the prefix you could check in the control you use to show the links whether there is a language prefix  for the external pages and remove it from the url.

    pseudo code:

    CmsSiteMapNode node;
    if (node.PageType == CmsPageType.External)
    {
        node.Url = "the new url here";
    }

    Kind regards,
    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.
  4. Markus
    Markus avatar
    2763 posts
    Registered:
    25 Nov 2005
    31 Oct 2009
    Link to this post
    Thanks for the additonal feedback.

    I really think 4.0 should try to leave 'physical' asp.net pages alone. Here is what happend to me.

    I did choose

    persistenceMode

     

    ="PathPrefix"

     


    GOOD - Sitefinity did after update to sp1 of 3.7 show my existing asp.net pages
    BAD  - it added /de/ or /en to the url

    Why bad

    1) Image Pathes broke
    2) Worse I had default language set to /de/  and had some /de/ in my existing URL - It seemd on all pages with /de/ in the 'physical' path of the existing asp.net pages - sitefinty would go into an endless loop!
    3) If you have an only payment system they may except only payment call for very specific URL which you had to tell them. Now Sitefinity adds /de/ or /en/ to the url wich means the paymentsystem will not work because the request comes form some other url then expected!

    Changing to

    persistenceMode

     

    ="QueryString"

    Seemd to take care of the above problems.

    Any feedback on the problemes describet would be nice.
    Alos if you can comment what might be advantages/disadvantages using QueryString vs. PathPrefix

    Regards Markus

     

  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 Nov 2009
    Link to this post
    Hi Markus Berchtold,

    With QueryString the language code is appended in the query string of the request. With PathPrefix. The language code is inserted as folder in the URL right after application root. Generally these are two different ways to get localization working. In your case QueryString seems to be more appropriate, although in both methods you should escape the pathprefix or querystrings.
    If you use Sitefinity 3.7 the PathPrefix should not be added to the external page url.

    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.
  6. Devin
    Devin avatar
    149 posts
    Registered:
    09 Jun 2009
    24 Jun 2011
    Link to this post
    Hi can you please explain how I might implement the pseudo code?  Which file should I put it in so that it works site wide?

    Thanks!
    Devin
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 Jun 2011
    Link to this post
    Hello Devin,

    You can put the code in ItemDataBound event of a navigation control you use. In this case you can access each data item and cast it to ICmsPage, then use the code provided above.

    Kind regards,
    Ivan Dimitrov
    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
  8. Jason
    Jason avatar
    21 posts
    Registered:
    12 Nov 2009
    07 Nov 2011
    Link to this post
    Earlier in this thread it is stated "If you use Sitefinity 3.7 the PathPrefix should not be added to the external page url."  On our 3.7 SP4 instances the pathprefix (en) is added to pages outside of sitefinity.  How do I prevent this from happening?  We have several directories in the website which hold aspx  pages that are not part of the sitefinity application but they are still getting the /en/ added to their urls which causes images to be broken.

    Thanks,

    -Jason
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    08 Nov 2011
    Link to this post
    Hi Jason,

    Have you tried one of the other ways to marrow down this issue suggested here?

    Kind regards,
    Ivan Dimitrov
    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
  10. Jason
    Jason avatar
    21 posts
    Registered:
    12 Nov 2009
    08 Nov 2011
    Link to this post
    Well, the link you provided is to this thread, so yes, I have seen these.  I can clarify the issue.....we have a directory within our sitefinity website which holds stand-alone aspx pages, that is pages created and managed outside of the SF environment.  Before upgrading to 3.7 SP4, these pages could be accessed via url that was not subject to sitefinity url re-writing for language handling.  After we upgraded, the urls for these pages now have the /en/ added to their urls.  This breaks the paths for images and other files referenced from those pages.

    I understand we could use the querystring option instead of the pathprefix for language handling however, we have over a dozen SF sites which have been using the pathprefix approach for several years and we do not want to change our URLs at this point.  How do we configure SF to continue using pathprefix and deliver same functionality we had prior to upgrade? 
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    09 Nov 2011
    Link to this post
    Hello Jason,

    I managed to replicate the issue. You can change the default behavior and remove appending the current UI culture by creating a custom class that inherits from CmsHttpModule. There is a virtual method

    GetCmsRequest which you have to override and return new CmsRequest(string param)
    Here you need to remove the language from context.Request.RawUrl if the request is made to your folder that holds the custom aspx pages you manage outside of Sitefinity.

    Finally you need to replace all instances of CmsHttpModule in the web.config with reference to your custom class.

    Greetings,
    Ivan Dimitrov
    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
  12. Jason
    Jason avatar
    21 posts
    Registered:
    12 Nov 2009
    09 Nov 2011
    Link to this post
    Thanks for your prompt reply.  While I appreciate the effort to identify and provide a solution for the issue, the breaking/changing of functionality between version updates (not to mention the inability to migrate from v3.x to v4.x) makes it difficult to continue to consider Sitefinity as solution to our long-term web content management needs.
Register for webinar
12 posts, 0 answered