-
-
Notifications
You must be signed in to change notification settings - Fork 291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return HTTP 301 instead of HTTP 302 #746
Comments
I'm afraid this would make no sense. Browsers would cache the redirect and you would stop tracking visitors. |
Actually, I have just quickly checked, and it looks like other URL shorteners are returning permanent redirects. For me it breaks a bit the purpose, as you would not be getting real visit stats. Any returning user would count just as one visit. Also, considering Shlink lets you edit the destination URL, this would make it have a weird behavior. But I will keep this open, and investigate a little further. It will also help me see interest on the feature. |
I just investigated the behaviour of bit.ly as an example: In my opinion a timeframe of 90 seconds would be acceptable for visit stats and a temporary inconsistent redirect behaviour when the destination was changed. Maybe you could implement permanent redirects with a Cache-Control header as a configuration option when creating a link so users can consciously choose the desired behaviour. |
Interesting. I never considered that, but it actually makes a lot of sense. Thanks for the tip, this is really valuable information. I will do some testing and experimentation, but if that approach works, I will definitely implement an option to configure what kind of redirection should be used. Thanks again :-) |
Just to clarify: Are you planning on creating a global option or a option local to the link creation? |
Probably both. You will be able to determine the default behavior, but also override it on a per-link basis if you want. That's what I've done with other options, like the short code length. However, it's very likely that I start with the global one, and then improve it later on. |
Hey @Laurendus. This is now implemented and will be part of v2.3.0 |
Very cool! I am looking forward to v2.3.0. And as always many thanks for your investment. |
@Laurendus with vacation, the pandemic and such, it's taken v2.3.0 a bit more than usual to be released, but it is finally available. It includes support for this. Feel free to open new issues if something doesn't work as expected. |
@acelaya Even without the pandemic totally understandable. I thank you again for your ongoing investment! |
Summary
When using the docker setup generated links return a HTTP 302 temporary redirect. This is bad for SEO so I would like shlink to be able to redirect with a HTTP 301.
If I haven't overseen something this would IMO be a small but great feature enhancement.
To respect use cases which do not contain a permanent redirect it could also be a configuration option.
If you do not have the time to implement this feature you could also point me to the relevant files and I will have an inexperienced try at it.
The text was updated successfully, but these errors were encountered: