Wordpress in subfolder NGINX 302 redirection

I have searched the forum for similar issues

on

This category is for general issues(=something is broken) regarding YunoHost, NOT apps.

on

This form is written in English but feel free to write in French if you’re more comfortable!

on

What type of hardware are you using

Old laptop or computer

What YunoHost version are you running

12.1.40.1

How are you able to access your server

The webadmin
Direct access via physical keyboard/screen

Describe your issue

I installed wordpress as subfolder of my main domain and configured yunohost to redirect to subfolder of it. At main domain there is also installed baikal in subfolder.

Mydomain.pl and in yunohost gui configured enable app wordpress
mydomain.pl/webpage

From human „visual” point of view everything works but Google and BING are refusing to index this webpage.
Google claims there is
„duplicated, google selected different canonical than user”

My main page has canonical “mydomain.pl/webpage”.

Investingating codes returned it looks like when executing

curl -I https://maindomain.pl

HTTP/2 302

which according to internet is temporary redirection which may affect how search enginees sees my webpage.

When checking redirect chain:

http://mydomain.pl/ status 301----> https://mydomain.pl/ status 302 ----> https://mydomain.pl/webpage status 301 —> https://mydomain.pl/webpage/ status 200

I tried to add forward slash ‘/’ in yunohost gui but it does not allow me to as “there is nothing to change”

Is it possible to make 301 redirection to wordpress hosted by Yunohost in main domain subfolder ?

Share relevant logs or error messages

LACK OF LOGs

The 302 on the bare domain is most likely produced by the nginx config that YunoHost generates for the domain root when the main app is a subpath, so first run yunohost app map and yunohost app info on the WordPress app to confirm the exact domain and path it is registered on. Then look for the redirect rule with grep -R “return 30” /etc/nginx/conf.d/ on the server to see which file sends the temporary redirect, and check the response again with curl -sI against both the http and https versions of the domain. If you want search engines to see a clean result, the simplest route is to avoid the redirect altogether by moving WordPress to the domain root with yunohost app change-url, since Baikal can stay on its own subpath. Manual edits to the generated nginx files can be overwritten on the next regeneration, so avoid hand-editing them unless you place a custom snippet in the domain’s own include directory.