redirect_ynh icon indicating copy to clipboard operation
redirect_ynh copied to clipboard

Can't redirect from `https://mydomain.tld/a_redirect_name` to `https://myotherdomain.tld/`

Open sebmennetrier opened this issue 2 years ago • 2 comments

Describe the bug

Found breaking change: Can't redirect from https://mydomain.tld/a_redirect_name to https://myotherdomain.tld/ and this behavior worked before PR #27. Now the redirection is opening https://myotherdomain.tld/a_redirect_name

Context

  • Hardware: not relevant
  • YunoHost version: 4.3.6.2 (not relevant)
  • I have access to my server: Through SSH and through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
  • Using, or trying to install package version/branch: master
  • If upgrading, current package version: no

Steps to reproduce

  • Install a redirect app from webadmin or from yunohost command with:
    • domain: mydomain.tld
    • path: /a_redirect_name
    • redirect_path: https://myotherdomain.tld/
    • redirect_type: public_302

Expected behavior

When opening https://mydomain.tld/a_redirect_name in a browser, the redirection should be done on redirect path https://myotherdomain.tld/ (like before PR #27)

Proposal

The behavior described in PR #27 (and so the solution) should be activated thanks a new options when the redirect app is installed or by adding choices in option redirect_type

sebmennetrier avatar Apr 11 '22 09:04 sebmennetrier

This pr should fix that: https://github.com/YunoHost-Apps/redirect_ynh/pull/37

zamentur avatar Jun 11 '22 12:06 zamentur

I can confirm that this is still a relevant issue; installing on a subdomain subpath e.g. installing on www.example.com/redirect configured to redirect to example.com results in redirecting to the URL example.com/redirect. This will only allow access to folders that are in the path containing /redirect on the destination URL. If this is intended, that is fine, however the explanation when installing is insufficient.

MadMan247 avatar Jul 08 '24 19:07 MadMan247