Discover the benefits of a hassle-free static WordPress site with Strattic

Experience faster publish times, compatibility with the most popular WP plugins, and award-winning support.

How do redirects work in the static site?

Our sites deal with a lot of 301 redirects to other websites. We currently use a plugin like SEO Redirection Plugin I’m not a coder so this question may be dumb, but if I use WP2Static to convert our WP sites to static, would all of the redirects set up with our re-direct plugins remain in place? I’m thinking “no” because they don’t edit .htaccess but rather handle that redirect through WP if I understand correctly. Any advice? Thank you 🙂

Great question, thanks for asking!

You’re spot on – those .htaccess redirects won’t be deployed to your static site automatically.

The current solution will depend on your deployment method:

  • for Netlify, using our Add-on, we provide a field for entering your redirects
  • for Netlify manual, you’ll need to download and extract the ZIP, add in a Netlify _redirects file, zip it up again and deploy
  • for deployment to servers utilizing an .htaccess file, you may be able to copy your existing .htaccess file, adjusting the URL patterns as required
  • for Amazon S3/CloudFront, you can setup redirects within S3 or if using CloudFront, you can attach a Lambda function that handle redirects to your distribution’s behaviour
  • for GitHub Pages, GitLab or BitBucket, you may be able to use a symlink to redirect traffic to a new path, but this may not give you the ability to choose the http status code. A last-resort for all deployment methods is to create an HTML page containing a meta refresh like <meta http-equiv="refresh" content="0; url=" /> (you may also want to include a canonical link tag just to be sure of no duplicate content indexing).
  • for Cloudflare Workers, you can either define the 301’s in your functions’s code or within the Page Rules section of the Cloudflare admin

Redirects are an important part of sites for SEO and user experience, so we’ll try to come up with a solution in the future. For now, if you would like a more seamless experience,  Strattic’s next generation static WordPress hosting is compatible with several of the major redirection plugins from the get-go.

Got some other ideas on how to deal with redirects? Contact us.