More in this section

Forums / Developing with Sitefinity / Localization URL Rewriting

Localization URL Rewriting

4 posts, 0 answered
  1. Jodie
    Jodie avatar
    59 posts
    Registered:
    09 Oct 2012
    09 Nov 2009
    Link to this post
    Hi All,

    We are wondering if it is possible to rewrite the urls for localization. Currently when navigating to a different language in the front end of the site the url looks like this 'www.domain.com/en/default.aspx', we would like it to appear like this 'www.domain.com/default.aspx' no matter what the language is.

    I understand that in the web.config the localization is set like this:

    '<localization defaultProvider="Sitefinity" persistenceMode="PathPrefix" defaultCulture="ar" cultures="ar,en" autoSetClientLanguage="false">'

    and the persistance mode can be PathPrefix, BrowserSettings, DomainName and Domain Extension.

    I am thinking what we want can be achieved with PathPrefix or Querystring if possible.

    Any help is appreciated and examples would be good also.

    Thanks in advance

    Jodie
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    10 Nov 2009
    Link to this post
    Hello Jodie,

    Thank you for contacting us.

    We haven't thought for such scenario, so we are not sure if that will work properly.

    Once you have set the autoSetClientLanguage="false" you could try to implement an HttpModule, which matches an url with /en/default.aspx and performs redirect to /default.aspx. This may lead to a circle reference though - we haven't tried it here. 

    Please register the module in the end of the httpModule collection in the web.config file, so the redirect happens after all the other things the CMS is doing. 

    Best wishes,
    Georgi
    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.
  3. Jodie
    Jodie avatar
    59 posts
    Registered:
    09 Oct 2012
    15 Nov 2009
    Link to this post
    Hi Georgi,

    Sorry for the belated response. We have to avoid redirecting as a result of some existing issues with this. I have learned there is alot more to what is required than the above, so will post when I have more details.

    Thanks alot

    Jodie
  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Nov 2009
    Link to this post
    Hello Jodie,

    Thank you for letting us know about the status of the issue.
    We are now closing the thread, but please feel free to open it at anytime when you have more details. 

    Greetings,
    Georgi
    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.
Register for webinar
4 posts, 0 answered