If you manage sites on a Plesk server, chances are you’ll eventually need to redirect one domain to another—maybe after a rebrand, a site consolidation, or a migration. On Plesk with Nginx enabled, the cleanest way to do this is using Additional nginx directives for the domain you want to redirect from.
In this guide, we’ll walk through:
- Redirecting an entire domain to
acme.com - A variant for redirecting a single URL
- Tips and common gotchas
All examples will use acme.com as the target site.
How Plesk Uses Nginx (Quick Overview)
On a typical Plesk server:
- Nginx runs as a reverse proxy in front of Apache.
- Requests hit Nginx first.
- “Additional nginx directives” let you inject your own Nginx config into that domain’s vhost.
Because redirects happen very early in the request flow, doing them at the Nginx layer is efficient and avoids unnecessary PHP/Apache overhead.
Redirect an Entire Domain to acme.com
Goal
Any request to this domain (say,
oldsite.com) should 301 redirect tohttps://acme.com, preserving the path and query string.
Example:
http://oldsite.com/about→https://acme.com/abouthttps://oldsite.com/products?id=123→https://acme.com/products?id=123
Step-by-Step in Plesk
- Log in to Plesk
- Go to Websites & Domains
- Click the domain you want to redirect from
(for example,oldsite.com). - Click Apache & nginx Settings
- Scroll down to Additional nginx directives
- Paste the following snippet:
12return 301 https://acme.com$request_uri; - Click OK or Apply to save changes.
That’s it. Once Plesk rebuilds the config, any request to that domain will 301 redirect to https://acme.com with the original path and query preserved.
Redirect Only a Single URL (Optional Variant)
Sometimes you don’t want to move the whole domain—just one page.
Goal
Only redirect
/old-pagetohttps://acme.com/new-page, while leaving everything else on the site as-is.
Nginx snippet
In Additional nginx directives for that domain, use:
|
1 2 3 4 |
location = /old-page { return 301 https://acme.com/new-page; } |
Notes:
location = /old-pagematches exactly/old-page(no trailing slash, no extra path).- Other URLs (like
/blog,/contact) will not be affected.
You can add multiple location blocks if you need multiple individual redirects.
Redirect Non-WWW to WWW on acme.com (Bonus Example)
If you host acme.com on the same Plesk server and want to redirect all http://acme.com traffic to https://www.acme.com, you can use:
|
1 2 3 4 |
if ($host = acme.com) { return 301 https://www.acme.com$request_uri; } |
This should be placed in Additional nginx directives for the acme.com vhost. (For many setups, it’s better to handle this at the DNS and vhost level, but this pattern is common and works fine for simple cases.)
How to Test Your Redirect
After saving your changes, test from your browser and from the command line.
1. Browser Test
- Visit
http://oldsite.com/and a few inner pages (like/about). - Confirm you end up at the corresponding
https://acme.com/...URLs.
2. Command Line Test (curl)
From a terminal:
|
1 2 |
curl -I http://oldsite.com/some-path |
You should see a 301 status and a Location header pointing to https://acme.com/some-path:
|
1 2 3 |
HTTP/1.1 301 Moved Permanently Location: https://acme.com/some-path |
If you see a 200 instead of 301, or the Location header is wrong, double-check the Nginx snippet and that you edited the correct domain in Plesk.
Common Gotchas
1. Wrong domain in the wrong vhost
Make sure you’re editing Apache & nginx Settings for the domain that actually receives the traffic you want to redirect.
2. Conflicts with other custom directives
If there are existing location blocks or other return directives in Additional nginx directives, they might conflict.
For a “simple everything to acme.com” redirect, you usually want the bare return 301 ... without additional location blocks around it, so it hits all requests.
3. Mixed content / caching weirdness
- Browsers sometimes cache redirects aggressively. Test in a private/incognito window if you’ve changed the target.
- If you had previous redirects (e.g., via
.htaccessor PHP), clear them out so Nginx is the single source of truth.
When to Use Nginx vs Apache for Redirects
On Plesk, you can also configure redirects using:
- Hosting Settings → “Permanent SEO-safe 301 redirect” (for some simple cases)
- Apache & nginx Settings → Additional Apache directives or
.htaccess
However, Nginx is generally preferred for:
- Global domain-to-domain redirects
- Performance and simplicity
- Avoiding per-request
.htaccessparsing
If you’re already using Nginx as a reverse proxy (the default), Nginx-level redirects are a clean, efficient solution.
Summary
To add a domain-wide redirect to acme.com on a Plesk server with Nginx:
- Go to Websites & Domains → [your domain] → Apache & nginx Settings
- In Additional nginx directives, add:
12return 301 https://acme.com$request_uri; - Save and test with your browser and
curl.
You’ll now have a fast, server-level 301 redirect that preserves URLs and sends traffic exactly where it needs to go.




