More in this section

Forums / Developing with Sitefinity / Links broken due to port being added to the URL

Links broken due to port being added to the URL

11 posts, 0 answered
  1. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    16 Dec 2011
    Link to this post
    Hi,

    For some reason, it seems the port is added to some URLs, while it shouldn't be.
    I have no idea why (some configuration problem somewhere?). This is causing issues for us (these URLs do not work because of the addition of the port), especially in 2 specific cases:

    1- We have a custom backend login page (to add https), which contains:
    <sf:LoginForm AllowSelectMembershipProvider="true" ID="LoginFormControl"
        RememberMeSet="true"
        ShowChangePasswordLink="false"
        ShowForgotPasswordLink="false"
        ShowHelpLink="false"
        ShowRegisterUserLink="false"
        DisplayRememberMe="true"
        DestinationPageUrl="~/Sitefinity"
        runat="server" />

    The DestinationPageUrl="~/Sitefinity" part makes it so a login page like this:
    https://mysite/Sitefinity/Login
    leads to:
    http://mysite:448/Sitefinity/

    (448 is the https port, the http one is 85. Only the login page is supposed to be https, the back office is supposed to be http.)

    2- On the backend "Pages" page, when you try to preview a page by clicking the "View" link, the port is added to the URL (ie: when clicking the link to view the home page, the link is http://mysite:85/home rather than just http://mysite/home)

    Any ideas?

    Thanks.
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    21 Dec 2011
    Link to this post
    Hello Thomas,

    There is a useful setting called "Site URL Settings" which allows you to change the absolute URLs generated by Sitefinity. It can be used when your installation is behind a specific port, have some internal redirection or use proxy. We have discussed a similar problem in this thread, so I can recommend it for you to review it.

    Greetings,
    Victor Velev
    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. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    21 Dec 2011
    Link to this post
    Hi Victor,

    Thanks for the tip. This seems to have fixed the second issue, but not the first one. Could be due to the HTTPS -> HTTP trip. Can you think of a solution?

    If everything fails, I guess I could hard code an absolute DestinationPageUrl value, but I'd like to avoid that.
  4. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    26 Dec 2011
    Link to this post
    Hello Thomas,

    It looks like some issue when calling Page.Response.Redirect (which we call with the parameter that you specify in DestinationPageUrl). I found the following article in StackOverflow:

    http://stackoverflow.com/questions/853513/how-to-overwrite-response-redirect-to-prevent-port-coming-with-it

    It looks like you could add this attribute - 

    useFullyQualifiedRedirectUrl="false"

    under the <httpRuntime> element. I hope this helps.

    Greetings,
    Lubomir Velkov
    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
  5. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    27 Dec 2011
    Link to this post
    Hi Lubomir,

    Thanks for your time.
    I also stumbled upon this info while looking for a solution. But that doesn't seem to be the problem, because the value of this attribute is false by default. Just in case, I double checked the value with this piece of code:

    HttpRuntimeSection section = ConfigurationManager.GetSection("system.web/httpRuntime") as HttpRuntimeSection;
    bool test = section.UseFullyQualifiedRedirectUrl;

    And it is false indeed.
  6. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    29 Dec 2011
    Link to this post
    Hi Thomas,

    Could you search your config files and web.config for this pattern: ":448" - I'm not sure where it is saved. Also please check if you have some Global.asax code that might perform a redirect.

    Greetings,
    Lubomir Velkov
    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
  7. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    29 Dec 2011
    Link to this post
    Hi Lubomir,

    No sign of "448" in our solution. It must get that dynamically from the server somehow.
    We do have a Global.asax,  but it doesn't perform a redirect. It add routes to enable the custom login page.

    I'll try setting the DestinationPageUrl property to an absolute URL next time I deploy the app in production environment (which I won't be able to do before January the 9th).
  8. Lubomir Velkov
    Lubomir Velkov avatar
    688 posts
    Registered:
    03 Nov 2014
    03 Jan 2012
    Link to this post
    Hello Thomas,

    It would help if you gave us access to your backend so we could investigate. It is possible that you added some custom code or widgets that redirect to this hardcoded port but you forgot about them. You could search in the sf_control_properties table, in the "val" column for ":448" as well - if there are any custom controls/widgets with this value they should be stored there.

    All the best,
    Lubomir Velkov
    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
  9. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    03 Jan 2012
    Link to this post
    Hi Lubomir,

    No, the port is not hardcoded in any way in the app. Actually, the same app works fine on other servers, so it specific to our production servers that have a more complex configuration.

    I'll be able to tell you next week if my workaround works or not.
  10. Thomas
    Thomas avatar
    223 posts
    Registered:
    19 Jan 2011
    07 Mar 2012
    Link to this post
    With all that said, it seems the port being added to the URL was a Sitefinity bug after all.
    http://www.telerik.com/support/pits.aspx#/public/sitefinity/8699

    I'll upgrade to SF 5.0 and see...
  11. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    08 Mar 2012
    Link to this post
    Hi Thomas,

    Please make sure to verify the behaviour on your end, using our official 5.0 release as the bug is marked as resolved.

    Regards,
    Victor Velev
    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
11 posts, 0 answered