Copied to clipboard

Flag this post as spam?

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


  • Sowndar M 50 posts 124 karma points
    Dec 05, 2019 @ 06:20
    Sowndar M
    0

    Rewrite rule for redierct the PDF to PDF not working

    I have tried to redirect the pdf to pdf by the following the rule in web.config

    <rule name="r_1" stopProcessing="true">
          <match url="^/media/peedin5t/xxx.pdf$" ignoreCase="false" />
          <action type="Redirect" url="/media/beebz4yx/xxx1.pdf" redirectType="Permanent" />
        </rule>
    

    I have cleared the cache and restart the server still it is not working even I replace the file in from path still it shows the old file only

  • Yakov Lebski 553 posts 2117 karma points
    Dec 05, 2019 @ 17:51
    Yakov Lebski
    0

    It can be cached by browser, check it in incognito mode in chrome

  • Sowndar M 50 posts 124 karma points
    Dec 06, 2019 @ 06:39
    Sowndar M
    0

    Yesterday I made a few changes in the code as shown below. Although it didn't work yesterday (i cleared the cookies, cache and clientdependency version change and checked), it started working well today. However, it works only in my system.

    I have tried it in other systems as well. It didn't work. Also, we cannot ask every customer to clear their caches and cookies for this.

    <rewrite>
    <rules>
    <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="/media/peedin5t/xxx.pdf" value="/media/beebz4yx/xxx1.pdf" />
        <add key="/media/peedin/FileThree.pdf" value="/media/peewerdinn/FileThreeNewFileName.pdf" />
        </rewriteMap>
        </rewriteMaps>
    
    </rewrite>
    
  • Yakov Lebski 553 posts 2117 karma points
    Dec 06, 2019 @ 06:47
    Yakov Lebski
    0

    you can't ask ....but you can check is it works in incoginto?

    if yes- we know the reason, if no - let's try find another solution

  • Sowndar M 50 posts 124 karma points
    Dec 09, 2019 @ 06:20
    Sowndar M
    0

    I found the solution. I have checked the maximum age(Max-age) of Response Header from the browser. The Cloudflare cache is set to the maximum age of 2592000(720 hours). That's why it is not reflecting the changes. So we asked the Cloudflare team to clear the cache the issue has solved

    enter image description here

Please Sign in or register to post replies

Write your reply to:

Draft