web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Error switching langua...
Power Pages
Answered

Error switching language on power page when query string is present

(0) ShareShare
ReportReport
Posted on by 21

I've set up a power pages site from the blank template and done no customisation other than adding two additional languages.

 

I have a scenario where a query string parameter needs to be appended to the site/page address.

 

This all works fine except that when switching from one language to another using the switcher drop down on the site, it will url encode the query string, including the ? mark, which then results in an ASP.NET error. I disabled custom errors on the site to show the full exception message.

 

PDL_1-1699240921011.png

 

PDL_2-1699240946851.png

 

 

Categories:
I have the same question (0)
  • oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at
    • did you create the localized Web Page for the additional languages? 
    • is this working without the additional parameter?
    • does the URL look right when you just hover over the additional language? 
  • PDL Profile Picture
    21 on at

    Yep it's all working without the additional query parameter.

     

    When hovering on the link, you can see its encoded there. The rendered link in devtools shown

     

    PDL_0-1699308874953.png

     

    Feels like I may have to hack it with some javascript until this gets fixed.

  • LucasRoss232 Profile Picture
    6 on at

    This seems to be a recently introduced issue with the language.url_substitution liquid object. I've been able to fix it in a hacky way using the language.code and request.url liquid objects (removing the domain from request.url):

     

     

    href="/{{ language.code }}{{ request.url | remove: "domain/en-US" | remove: "domain/fr-FR" }}

     

    This seems to return the correct URL for language switching.

     

    Correction: This didn't actually work. Had to go with some Javascript function to change the href.

  • Verified answer
    PDL Profile Picture
    21 on at

    I raised a ticket with MS and they confirmed a recent change has resulted in this default behavior. 

     

    The good news is that it can be switched off with a portal site setting called Site/EnableLanguageDropUrlEncoding.

     

    Set to false to switch off the encoding.

     

    PDL_0-1699578840016.png

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
sannavajjala87 Profile Picture

sannavajjala87 38 Super User 2026 Season 1

#2
Valantis Profile Picture

Valantis 35

#3
Fubar Profile Picture

Fubar 23 Super User 2026 Season 1

Last 30 days Overall leaderboard