Giter Club home page Giter Club logo

Comments (5)

khalwat avatar khalwat commented on July 22, 2024

Retour only works when the request goes through Craft. It's very likely that your Nginx setup does not route requests for static assets like images through Craft. This is pretty common for performance reasons, but it also means that your intended use-case will not work.

from craft-retour.

turnstylerj avatar turnstylerj commented on July 22, 2024

Would it be possible to detect if the asset the field is on isn't using local storage and, if so, set the redirect destination to the external asset URL? I only ask because setting up a static redirect from /path to works fine as a redirect.

from craft-retour.

khalwat avatar khalwat commented on July 22, 2024

Wait, you're saying the same exact thing works when not in a Short Link field? So the short link "alias" is the only thing not working in this case?

from craft-retour.

turnstylerj avatar turnstylerj commented on July 22, 2024

Yes, that's correct. If I'm on https://my-site.com and go to Retour > Redirects and choose "New Static Redirect", I can set a path /my-path, and a destination to the full URL of an external asset https://my-cdn.com/my-asset.pdf, and then https://my-site.com/my-path will correctly redirect to the external asset.

But if I have a Short Link field on the asset where I set /my-path as the value, then https://my-site.com/my-path will just redirect to https://my-site.com.

from craft-retour.

khalwat avatar khalwat commented on July 22, 2024

Fixed in the above commits.

Craft CMS 3:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-retour": "dev-develop as 3.2.16”,

Then do a composer clear-cache && composer update

…..

Craft CMS 4:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-retour": "dev-develop-v4 as 4.1.17”,

Then do a composer clear-cache && composer update

…..

Craft CMS 5:

You can try it now by setting your semver in your composer.json to look like this:

    "nystudio107/craft-retour": "dev-develop-v5 as 5.0.1”,

Then do a composer clear-cache && composer update

from craft-retour.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.