Redirecting an environment’s *.mightybox.site domain to its production domain

To prevent any SEO indexing issues as you transition an environment from staging to production, we might consider redirecting the domain via .htaccess. Here’s how.

1. On the AppServer level, click on the wrench icon to access Config. Navigate to /var/www/webroot/ROOT/.htaccess

2. At the top of .htaccess, add the code snippet below to automatically redirect all traffic to your production domain. Make sure to replace the example domain with your own.

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} !^domain.com$
  RewriteRule ^/?(.*)$ https://domain.com/$1 [R=301,L]
</IfModule>