Plesk serves websites with nginx in front of Apache by default. That gives you two places to put redirect and rewrite rules: the familiar .htaccess file for Apache, and Additional nginx directives in the panel. This guide explains which to use and gives working examples.
Before you start
- Know your PHP handler: open the domain's Hosting & DNS → Apache & nginx settings. If Proxy mode is off and PHP is served by nginx,
.htaccessis ignored. - Back up any existing
.htaccessbefore editing.
Force HTTPS the easy way
Open the domain's SSL/TLS Certificates page (SSL It!) and switch on Redirect from http to https. This is cleaner than writing rules and survives CMS updates. Use rules only for more specific redirects.
Choose www or non-www
- Go to Websites & Domains and open Hosting & DNS → Hosting for the domain.
- Set Preferred domain to
example.comorwww.example.com. - Click OK. Plesk adds a permanent 301 redirect for the other name.
- Open Hosting & DNS → Apache & nginx.
- Scroll to Additional nginx directives.
- Enter rules, for example:
- Run
curl -I http://example.com/old-page/and look for301and the rightLocationheader. - Test in a private browser window; browsers cache 301 redirects aggressively.
- ERR_TOO_MANY_REDIRECTS: two rules send visitors back and forth, often HTTPS redirect in Plesk plus another in
.htaccessor Cloudflare set to Flexible SSL. Keep one HTTPS redirect and use Cloudflare's Full (strict) mode. - .htaccess has no effect: PHP or static files are served directly by nginx. Enable proxy mode or move the rule to nginx directives.
- 500 after editing .htaccess: a typo or unsupported directive. Check the Log Browser for the exact line.
- Let's Encrypt renewal fails: exclude
/.well-known/acme-challenge/from blanket redirects.
Redirects with .htaccess (Apache)
Edit httpdocs/.htaccess in the File Manager. Redirect a single page:
Redirect 301 /old-page/ https://example.com/new-page/Redirect a whole old folder using mod_rewrite:
RewriteEngine On
RewriteRule ^blog/(.*)$ https://example.com/news/$1 [R=301,L]Place custom rules above the WordPress block (# BEGIN WordPress) so they run first.
Additional nginx directives
location = /old-page/ { return 301 https://example.com/new-page/; }Click OK. Plesk tests the configuration and refuses to save if there is a syntax error, which protects other sites. nginx redirects are faster than Apache ones because the request never reaches Apache.
Additional Apache directives
The same page has Additional directives for HTTP and HTTPS. These go into the Apache virtual host and are useful for directives not allowed in .htaccess. Remember that HTTP and HTTPS are separate boxes – add the rule to both if needed.
