Skip to content
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

Base URL redirects always use 302? #867

Closed
codaamok opened this issue Oct 25, 2020 · 4 comments · Fixed by #893
Closed

Base URL redirects always use 302? #867

codaamok opened this issue Oct 25, 2020 · 4 comments · Fixed by #893
Milestone

Comments

@codaamok
Copy link

codaamok commented Oct 25, 2020

Maybe I'm seeing things, but am I correct in observing that the redirect options you configure when invoking ./install are always 302, even if the user configures their short codes to be issued with 301? I have multiple domains responding on my shlink instance and I had to implement nginx rules to return 301 instead of 302 if someone queried $http_host = mydomain.com and $request_uri = /.

When a user advises Google of a "Change of address" via the Google Search Console, Google is expecting 301 and will not let the user submit the "Change of address" if it is anything else.

@acelaya
Copy link
Member

acelaya commented Oct 25, 2020

This shouldn't probably be the case. If you have configured custom redirects for "not found" URLs, they should honor the type of redirects you configured, probably.

I'll take a look to see if there's any other consideration, but this looks like a bug to me.

@acelaya acelaya added the bug label Oct 25, 2020
@acelaya acelaya added this to the 2.4.1 milestone Nov 10, 2020
acelaya added a commit to acelaya-forks/shlink that referenced this issue Nov 10, 2020
acelaya added a commit to acelaya-forks/shlink that referenced this issue Nov 10, 2020
acelaya added a commit to acelaya-forks/shlink that referenced this issue Nov 10, 2020
@acelaya
Copy link
Member

acelaya commented Nov 10, 2020

Hey @codaamok, I have fixed this behavior, so that redirects configured for the base path, not found short URLs and other not-found paths also respect the same status code configured during installation.

I even considered hardcoding higher caching times for these three, but I finally used the same logic as for regular short URLs, because it's planned to make shlink track these visits too, at some point.

The fix will be released later today/tomorrow with v2.4.1

@acelaya
Copy link
Member

acelaya commented Nov 10, 2020

The v2.4.1 has just been released, including the fix for this.

@codaamok
Copy link
Author

That's awesome, thank you so much @acelaya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants