🔁 Why 301 Redirects are Needed

301 redirect is a permanent redirect that informs search engines and browsers that a page has permanently moved to a new address. This is important for SEO to:

  • Avoid content duplication
  • Maintain positions in search results
  • Ensure proper indexing

🔧 Main Types of Redirects

🌐 From www to non-www (or vice versa)

Search engines perceive www.domain.com and domain.com as different sites. Without a redirect:

  • Content duplication occurs
  • Link equity is diluted

🔒 From HTTP to HTTPS

SSL encryption is the standard of the modern internet. Google prefers secure sites.

🛠️ Configuration in Nginx Proxy Manager

1. Creating a Redirection Host

  1. Log into the control panel (port 81)
  2. Go to the Hosts → Redirection Hosts section
  3. Click Add Redirection Host

2. Configuring www → non-www


Domain Names: www.your-domain.com
Scheme: https
Forward Hostname: your-domain.com
Preserve Path: enabled
Status Code: 301

3. Configuring HTTP → HTTPS


Domain Names: your-domain.com
Scheme: https
Forward Hostname: your-domain.com

⚙️ Advanced Settings via Proxy Hosts

An alternative is to use Force SSL:

  1. Create a Proxy Host with the desired domain
  2. Configure SSL: select the certificate, enable Force SSL, HTTP/2, HSTS

📌 Canonical Domain


server_name domain.com www.domain.com subdomain.domain.com;
if ( $host != domain.com ) {
    return 301 $scheme://domain.com$request_uri;
}

🔍 Checking and Testing

  • Check the 301 status
  • Ensure the URL is preserved
  • Check the operation of SSL certificates

Tools: curl -I http://www.domain.com, Browser DevTools, online checks

⚠️ Common Mistakes

  • Endless redirect loops
  • SSL issues: the certificate must cover all versions

📊 Monitoring and Maintenance

  • Check logs for errors and the number of redirects
  • Changes are applied automatically

📈 SEO Recommendations

  • Select the canonical version of the domain
  • Update internal links and sitemap.xml
  • Set up canonical tags
  • Notify Google via Search Console

✅ Conclusion

Proper configuration of 301 redirects is the foundation of technical site optimization. It improves UX, preserves SEO, and helps search engines index content correctly.