Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Henning Molbaek 49 posts 99 karma points
    Jun 30, 2020 @ 10:35
    Henning Molbaek
    0

    Internal error on https redirects

    Hi,

    For some reason I get an Internal 500 error when I try to add the following to the web config on a Umbraco V8 site:

    <rewrite>
         <rules>
                <rule name="HTTP to HTTPS redirect" stopProcessing="true">
      <match url="(.*)" />
      <conditions>
        <add input="{HTTPS}" pattern="off" ignoreCase="true" />
        <add input="{HTTP_HOST}" pattern="localhost" negate="true" />
      </conditions>
      <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
    </rule>
                </rules>
            </rewrite>
    

    I have never had any issues with this on version 7. Any ideas? I run this on Windows 2019 server with latest updates.

    Note: The site works great with https if I type it into the browser.

  • Patrick van Kemenade 101 posts 339 karma points
    Jun 30, 2020 @ 11:55
    Patrick van Kemenade
    0

    Dear Henning,

    Your code is pretty similar with what I use on my live server Umbraco v8, here is my code:

            <rule name="HTTP to HTTPS redirect" stopProcessing="false">
          <match url="(.*)" />
          <conditions>
            <add input="{HTTPS}" pattern="^OFF$" />
            <add input="{HTTP_HOST}" matchType="Pattern" pattern="^localhost(:\d+)?$" negate="true" />
            <add input="{HTTP_HOST}" matchType="Pattern" pattern="^127\.0\.0\.1(:\d+)?$" negate="true" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" redirectType="Permanent" />
        </rule>
    

    Could you try mine version, see if it works and if so one by one change it back to your version to see where it breaks.

    Also where are you getting the 500 error on the frontend or the backend ?

    Also a thing to add (also the health check was writing error in my log on localhost is this):

    <appSettings>... other settings ...<add key="Umbraco.Core.UseHttps" value="true" /></appSettings>
    

    Another thinh to note is that you have set stopProcessing to true, is this the last rule in rules ? Otherwise other rules which needed to fire are maybe prevented by this rule causing the error.

    Please let me kno what the issue is. And if anybody has feedback or improvements on my rewrite https code please let me know also.

  • Henning Molbaek 49 posts 99 karma points
    Jun 30, 2020 @ 11:58
    Henning Molbaek
    0

    What would the correct one be for:

    1. It is the only rule.
    2. It is not a localhost site but a live domain.
  • Patrick van Kemenade 101 posts 339 karma points
    Jun 30, 2020 @ 12:02
    Patrick van Kemenade
    0

    I use this one on both my localhost and on my live website.

    Have you tried what happens if you change your rule with my code, do you get the same error ?

  • Henning Molbaek 49 posts 99 karma points
    Jun 30, 2020 @ 12:05
    Henning Molbaek
    0

    Same error. It is on the frontend.

  • Patrick van Kemenade 101 posts 339 karma points
    Jun 30, 2020 @ 12:16
    Patrick van Kemenade
    0

    Then I'm pretty sure the error isn't in the rewrite rule but somewhere else.

    Have you tried to trouble shoot it by accessing a static resource http://<your-site>/images/yourimage.jpg then you at least know if the bindings and routing is working.

    Note, you also double checked you have both the http and https bindings in IIS ?

    Also does the umbraco log, log anything. If not next step is the windows log.

  • Mona 36 posts 106 karma points
    Jul 11, 2021 @ 12:51
    Mona
    0

    Dear Patrick,

    I'm facing issue with Umbraco Multi language website English & Arabic. English (en-US) is working fine as default language. Arabic (ar-SA) secondary language is not working, showing 404 error, page does not exist. Domains setting with Culture and Hostnames https://localhost:4865 https://localhost:4865/ar

    I followed all steps of this link: https://www.youtube.com/watch?v=-vzxCdjq4FM&ab_channel=UmbracoHQ enter image description hereenter image description hereenter image description hereenter image description hereenter image description here Plz assist.

  • Patrick van Kemenade 101 posts 339 karma points
    Jul 11, 2021 @ 16:40
    Patrick van Kemenade
    0

    Hello Mona,

    Don't see an error immidiatly on the information provided.

    3 things to check:

    1. I notice that on the English version you name the page "Home" On the Arabic version you use a different name "AR" and have and extra page called Home Content. Kind of wonder why this is and why you use an extra "Home Content" page. Think you don't need the "Home Content" and naming "ar" making things a bit easier I think.

    2. Check in "URL redirect management" in there happens to be a redirect from "AR" to something from a previous test/save (also checking redirects in web.config might help)

    3. Do both pages use the same template ? It's cut of in the screenshots so I can't check. Also if you put a breakpiont in the very first line of the template does it reach this line ?

    Also not sure, but in my setup I use a trailing / everywhere, think it's also possible without but not 100% sure.

    And of course always clear cache and clear data directory and recylcle bin when encountering errors that don't make any sense, so there is no incorrect old stuff causing issues.

    Hope this helps otherwise let me know how I can contact you, I'm more then happy to do a remote meeting where I can look if I can trouble shoot the issue.

  • Mona 36 posts 106 karma points
    Jul 12, 2021 @ 05:57
    Mona
    0

    Dear Patrick,

    Thanks for quick reply. I will check as per your comments and will get back to you.

    Thanks

  • Mona 36 posts 106 karma points
    Jul 12, 2021 @ 07:32
    Mona
    0

    Dear Patrick,

    I did check the points you mentioned and my comments are as follows:

    Home Content: It is used to show the home page contents like page banner, short links for news, events, campaigns etc.; This Home Content is used in arabic version as well.

    Regarding the name of nodes, i used

    Home for English (https://localhost:4865)

    Home-ar for Arabic (https://localhost:4865/ar)

    URL rewrite: following is the URL rewrite script from web.comfig FYI. enter image description here

    Recycle Bin is now empty.

    Still the same issue. The main issue that its not recognizing the Arabic version pages and showing/redirect to 404 page.

  • Patrick van Kemenade 101 posts 339 karma points
    Jul 12, 2021 @ 09:26
    Patrick van Kemenade
    0

    Ok, assuming you use the same template on both. And you you did a test of placing a breakpoint on the first line of code in the view (maybe in the view a redirect occurs).

    And you check url redirect manager in Umbraco to check if any redirects for ar exists from a previous save.

    Also in the 404 page can you check the referer, is it localhost:<port>/ar or do you get there from a different url ?

    Then it must be a routing issue. The main difference between your setup and mine is that I use a trailing slash while you remove it. But I think both must be possible.

  • Mona 36 posts 106 karma points
    Jul 12, 2021 @ 12:06
    Mona
    0

    Dear Patrick,

    Its localhost:4865/ar

    i would like to let know that node ID for both English and Arabic nodes are same, is it ok or it should be different ?

  • Patrick van Kemenade 101 posts 339 karma points
    Jul 12, 2021 @ 13:10
    Patrick van Kemenade
    0

    Yes, that's ok (same as I have).

    If you open the English version, you can click on the dropdown to show both version English/Arabic side by side, correct ?

    Don't know why you get the error, but if you can reach out to me I'm happy to spend a few minutes to see if I can trouble shoot in in a remote meeting -> https://onlinegrowthcoach.com/ (see banner Information + contact)

  • Mona 36 posts 106 karma points
    Jul 12, 2021 @ 13:46
    Mona
    0

    Dear Patrick,

    Sure i would like to sit with you to resolve the issue. We can sit tomorrow 13th July 2021 at 10:00 am KSA time zone, is it OK with you or you can suggest me your convenient time to have meeting.

    I will suggest to use TeamViewer in order to share the screen.

    I have to learn lots of things from you regarding the Umbraco.

    Please find below screenshot for the Split view of both langs.

    My gmail ID is [email protected]

    enter image description here

  • Mona 36 posts 106 karma points
    Jul 15, 2021 @ 14:05
    Mona
    0

    Dear Patrick,

    i apologize for late reply, i've solved the language issue, now English and arabic both are working. There are some scripts are not working but at last Arabic is working. I would like to ask you to add seperate stylesheet for arabic language. How to add. Please check the following screenshot of master.cshtml

    enter image description here

    Please let me know what and where to add the script which will adopt the css file as per the language selection. i.e. if i select arabic language, it should link master-ar.css else master.css

    Thanks

  • Gerty Engrie 130 posts 490 karma points c-trib
    Dec 15, 2020 @ 22:43
    Gerty Engrie
    0

    Have you installed the rewrite module for IIS?

Please Sign in or register to post replies

Write your reply to:

Draft