Copied to clipboard

Flag this post as spam?

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


  • Jesper Flindt 5 posts 96 karma points
    Nov 09, 2021 @ 10:46
    Jesper Flindt
    0

    Cannot redirect deleted PDF URL

    On an Umbraco Cloud project running Umbraco 7.12.5 I am using the paid version of the SEOChecker package.

    The case is:

    I have a PDF that has been deleted - and we have a lot of (printed) QR codes linking to that file.

    I therefore wish to add a redirect so the deleted PDF link links to a page.

    OLD URL:

    /media/1860/oplevelseskort-oversigt.pdf
    

    NEW URL:

    /gavekort/
    

    But the redirect is not working - I can redirect other pages fine but I cannot redirect "media file URLs".

    I have already been in contact with the devs of the SEOChecker package and checked everything and all appears good.

    Their suggestion is that the HTTPModule is not running as intended in the Umbraco installation - I've tried reaching out to Umbraco Cloud support but after a month they have replied that they cannot help with 3rd party package issues.

    Which brings me here...

    My question - has anyone here experienced the same issue either with or without the SEOChecker package and if so how did you solve it?

    best

    Jesper

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Nov 09, 2021 @ 22:57
    Marc Goodson
    100

    Hi Jesper

    Could you add a redirect rewrite rule in the Web site's Web.Config file?

    Something like this?

                <rule name="PDF Redirection using map">
                    <match url=".*" />
                    <conditions>
                        <add input="{PDF Redirection:{REQUEST_URI}}" pattern="(.+)" />
                    </conditions>
                    <action type="Redirect" url="{C:1}" appendQueryString="false" />
                </rule>
            </rules>
            <rewriteMaps>
                <rewriteMap name="PDF Redirection">
                    <add key="/assets/12345/FileOne.pdf" value="/media/FileOne.pdf" />
                    <add key="/assets/55555/FileTwo.pdf" value="/media/NewFileTwoName.pdf" />
                    <add key="/assets/22222/FileThree.pdf" value="/resources/FileThreeNewFileName.pdf" />
                </rewriteMap>
            </rewriteMaps>
    

    I think that should still work on Umbraco Cloud.

    This rule should fire at the we server level before SEO Checker or Umbraco gets to handle the request...

    Regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft