Redirects
SpinupWP currently supports two different types of redirect:
- Domain redirects (e.g. redirecting www.example.com to example.com)
- Path redirects (e.g. redirecting example.com/old-post to example.com/new-post)
Domain redirects are handled automatically by SpinupWP. Path redirects need to be added manually to a Nginx config file.
Domain Redirects
Redirecting additional domains to the primary domain can be done by enabling the “Redirect to Primary Domain” toggle when creating or updating a site in SpinupWP.
This will ensure each additional domain will 301 (permanent) redirect to the primary domain. Note that SpinupWP will automatically handle redirecting these additional domains to HTTPS if HTTPS is enabled for the site.
Path Redirects
If you want to set up a redirect in Nginx to redirect one path on your site to another path on the same site you can do so by following these steps:
- SSH to your server using a sudo user.
- Create a new file within
/etc/nginx/sites-available/{DOMAIN}/server
(the file name is up to you but we recommend something likecustom-redirects.conf
) with the following contents:location /old-slug { return 301 /new-slug; }
-
Test that the configuration is correct using
sudo nginx -t
- If everything looks good, reload Nginx
sudo service nginx reload