How to avoid redirect loading page on nagix + PHPfpm Based Server?

Os: Ubuntu 20.0
Panel: HestiaCP (Latest Version)
Scripts: NaginX, PHP-FPM, Multi-PHP and Others.

Due to Redirects it takes more time to get response from server. As a result it takes more time to get response on browse.

Redirect Example:
From http://domain.com
Then it redirects to https://domain.com
Then finally it reach https://www.domain.com.

What i want to accomplish?
I want to make server response time faster and avoid extra redirects or minimize redirect time.

It there anyone who can help me with this issue?

don’t use http://domain.com in any links anywhere to start with. rather only use https://www.domain.com in the first place. the redirect(s) are only a fallback for the first time someone might enter this without s and www. so you are trying to optimize on a problem that isn’t there, unless you reference your assets wrong.

of course you can use a single rewrite instead of two, to always redirect to https://www. in the first place, but as said above, that’s in the end not what you should worry about. there is nothing more to optimize about a redirect to deal with “wrong” urls.

1 Like