Redirect users to a custom domain or web address you can't use code 302

Hi everyone, I added a domain angeltales.angellive.ru, and when accessing it, I direct it to a different domain quantumtransition.angellive.ru, and no matter how much I try to save in the panel, it still leaves exactly 301. I don’t see any errors in the console, logs

D='6660' DATE='2025-02-25' TIME='00:32:17' LEVEL='Info' CATEGORY='System' MESSAGE='Service restarted (Name: nginx).'
025-02-25 00:32:13 v-change-web-domain-stats  'user' 'angeltales.angellive.ru' 'awstats'
2025-02-25 00:32:17 v-restart-service  'nginx' ''
2025-02-25 00:32:17 v-add-web-domain-ssl-force  'user' 'angeltales.angellive.ru'
2025-02-25 00:32:17 v-restart-service  'nginx' ''
2025-02-25 00:32:17 v-add-web-domain-ssl-hsts  'user' 'angeltales.angellive.ru'
2025-02-25 00:32:18 v-change-web-domain-stats  'user' 'angeltales.angellive.ru' 'awstats'
2025-02-25 00:32:21 v-add-web-domain-redirect  'user' 'angeltales.angellive.ru' 'quantumtransition.angellive.ru' '302'
2025-02-25 00:32:22 v-restart-service  'nginx' ''
2025-02-25 00:33:46 v-change-web-domain-stats  'user' 'angeltales.angellive.ru' 'awstats'
2025-02-25 00:33:50 v-restart-service  'nginx' ''
2025-02-25 00:33:50 v-add-web-domain-ssl-force  'user' 'angeltales.angellive.ru'
2025-02-25 00:33:51 v-restart-service  'nginx' ''
2025-02-25 00:33:51 v-add-web-domain-ssl-hsts  'user' 'angeltales.angellive.ru'
2025-02-25 00:33:51 v-change-web-domain-stats  'user' 'angeltales.angellive.ru' 'awstats'
2025-02-25 00:33:55 v-restart-service  'nginx' ''

And strangely it somehow redirects it

curl -I -L http://angeltales.angellive.ru                                                                              ✔ 

HTTP/1.1 301 Moved Permanently
Server: nginx
Date: Mon, 24 Feb 2025 21:42:05 GMT
Content-Type: text/html
Content-Length: 162
Connection: keep-alive
Location: https://angeltales.angellive.ru/

HTTP/2 302 
server: nginx
date: Mon, 24 Feb 2025 21:42:05 GMT
content-type: text/html
content-length: 138
location: https://quantumtransition.angellive.ru/
strict-transport-security: max-age=31536000;

HTTP/2 200 
server: nginx
date: Mon, 24 Feb 2025 21:42:05 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
link: <https://quantumtransition.angellive.ru/wp-json/>; rel="https://api.w.org/"
link: <https://quantumtransition.angellive.ru/wp-json/wp/v2/pages/786>; rel="alternate"; title="JSON"; type="application/json"
link: <https://quantumtransition.angellive.ru/>; rel=shortlink
strict-transport-security: max-age=31536000;
alt-svc: h3=":443"; ma=86400

And yet 301 or 302 and is it possible to make only 302?

Hi @bestperson

You have selected to redirect http to https automatically and tha’s the reason for the 301 redirection (this 301 redirection is hardcoded in Hestia):

❯ grep -r 'return 301 https' /usr/local/hestia/
/usr/local/hestia/bin/v-add-web-domain-ssl-force:       echo 'return 301 https://$host$request_uri;' > $forcessl
/usr/local/hestia/func/domain.sh:                       echo 'return 301 https://$server_name$request_uri;' > $forcessl

If you try to access https instead of http you will only see the 302 redirection:

❯ curl -I -L https://angeltales.angellive.ru
HTTP/2 302 
server: nginx
date: Tue, 25 Feb 2025 00:22:36 GMT
content-type: text/html
content-length: 138
location: https://quantumtransition.angellive.ru/
strict-transport-security: max-age=31536000;

HTTP/2 200 
server: nginx
date: Tue, 25 Feb 2025 00:22:36 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
link: <https://quantumtransition.angellive.ru/wp-json/>; rel="https://api.w.org/"
link: <https://quantumtransition.angellive.ru/wp-json/wp/v2/pages/786>; rel="alternate"; title="JSON"; type="application/json"
link: <https://quantumtransition.angellive.ru/>; rel=shortlink
strict-transport-security: max-age=31536000;
alt-svc: h3=":443"; ma=86400
3 Likes