GithubHelp home page GithubHelp logo

Comments (5)

ash-jc-allen avatar ash-jc-allen commented on August 16, 2024

Hey! I'm doing well thanks and hope you are too? 😄

Sorry that you're having issues with the package. Hopefully, we can figure out what's going on with it! I have a hunch that your issue might be similar to #199 in that you're creating your short URLs using a 301 redirect status code.

Just to copy some info over from the other issue:

By default, the short URLs that are created are given a 301 status code. So the first time you visit your short URL, you will hit your Laravel app and be redirected to the destination URL. But the browser will remember this destination URL, so next time you try and visit the short URL, your browser will redirect you straight to the destination URL. This means you'll never hit your Laravel app after the first time you visit it (in the same browser).

First visit:

Short URL -> Laravel app -> Destination URL

Second, third, forth, etc visit:

Short URL -> Destination URL

If you'd like to hit your Laravel app on every request, you could set your redirect status code to be 302 instead (https://github.com/ash-jc-allen/short-url#redirect-status-code).

My guess is that your short URLs are being created with a 301 status code, so your web browser isn't visiting your Laravel app again to check if the URL changed.

Would you be able to confirm whether this is the case? 🙂

from short-url.

hardlevel avatar hardlevel commented on August 16, 2024

from short-url.

ash-jc-allen avatar ash-jc-allen commented on August 16, 2024

As far as I'm aware, if a user has already visited a link that had a 301 redirect code, they'll need to clear their browser's cache (I think). Otherwise, their browser will permanently redirect to the old destination URL that they were originally redirected to 🙂

from short-url.

hardlevel avatar hardlevel commented on August 16, 2024

this is not a problem, the links are not public yet...

but I have to do something with the existing links to support editing?

from short-url.

ash-jc-allen avatar ash-jc-allen commented on August 16, 2024

Without looking at your project, it's difficult to know what you might need to do to support editing. But I imagine that you'll probably need to update all your existing links in the database to use a 302 redirect status code by updating the values in the redirect_status_code column in the short_urls table 🙂

from short-url.

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.