YunoHost-Apps / redirect_ynh

Redirection app for YunoHost
GNU Affero General Public License v3.0
44 stars 21 forks source link

Relative redirect #29

Closed tiotrom closed 2 years ago

tiotrom commented 3 years ago

I have domain.com and I want all requests to go to www.domain.com. So if user visits domain.com/path/whatever to redirect to www.domain.com/path/whatever. Is this possible?

NathanRHD commented 3 years ago

(Not sure if possible, but I'm looking to do something similar!)

tiotrom commented 3 years ago

I did it manually by editing the etc/nginx/conf.d/website.d and adding this

location / {
    return 301 https://www.website.domain/$uri$is_args$args;

}
h3ndrik commented 3 years ago

i'd do $request_uri instead of /$uri$is_args$args

this should probably be fixed. i think most people wouldn't expect that a redirect throws away all path information.

Edit: there's already this pull request open: https://github.com/YunoHost-Apps/redirect_ynh/pull/27