title: Redirect Specific Sub-domains .HTACCESS For WordPress Multisite With Wildcard SSL And No Internal Redirects
body: <p>I am attempting to map specific subdomains on my WordPress Multisite.</p>
  <p>I have successfully mapped my multisite subdomains to their new domains.</p>
  <p><strong>Example:</strong></p>
  <h2>Store5.domain.com is now successfully changed to prodomain.com and everything works fine, up and to one point.</h2>
  <p>I need to make it so that anyone who knew about store5.domain.com will be redirected to prodomain.com</p>
  <p>I have several instances of this, where I will need to replicate this code often as I perform these changes, so any assistance in understanding how I am using this code would be very helpful for me.</p>
  <p>What can I do to safely adjust my .htaccess file so I can 301 redirect people from the specific domain(s)?</p>
  <p><strong>Example:</strong>
  The now out of use: storeX.domain.com <em>301 permanent redirects</em> to the live prodomain.com</p>
  <p>I cannot accomplish this in a simple fashion because I am using SiteGround, I am using a wildcard subdomain and wildcard SSL on the core domain to safely auto-secure the SSL certificates for any newly added subsites.</p>
  <p>Because of the wildcard SSL, and because there is a Wildcard Subdomain, I am unable to create a core redirect for Store5.domain.com from within the control panel like normal, and because they are subdomains rather than sub-directories (sub.domain.com / not domain.com/sub) I cannot use a simple fix like a redirection plugin.</p>
  <p>The only option I understand that will work will be redirection using .htaccess.</p>
  <ul>
  <li><strong>Additional Goal:</strong> Ideally, I would like to include a way to make it so that if someone visits store5.domain.com/product/name will get redirected like a wildcard redirect, where it doesn't matter what they put after the slash, the first part will change from store5.domain.com to prodomain.com and the end of it will remain unchanged.*</li>
  </ul>
  <p>My current htaccess looks like this (I have zero skill in writing htaccess):</p>
  <pre><code>RewriteEngine On
  RewriteBase /
  RewriteRule ^index\.php$ - [L]
  
  # add a trailing slash to /wp-admin
  RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
  
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^ - [L]
  RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
  RewriteRule ^(.*\.php)$ $1 [L]
  RewriteRule . index.php [L]
  AddHandler application/x-httpd-php74 .php .php5 .php4 .php3
  </code></pre>