Categories
guides wordpress

Errors Importing Prebuilt Template from Avada 7+

This may be an edge case that no one else has issues with, but here is my setup:

  • cPanel SiteGround hosting
  • Primary primary.tld site lives in the public_html/ folder, and many staging sites live in public_html/staging/.
  • DNS points newdomain.staging.tld to SG IP address
  • SG cPanel configured with subdomain pointing to specific folder inside staging/
  • The root site has an .htaccess rule to redirect anything on port 80 to https://rootsite.tld/$1
  • staging/ folder has AuthType Basic set

I’ve imported several Avada templates with the above configuration without issue in the past. This is the first time attempting with Avada 7+ and WP 5.5.1 – maybe it is some conflict with them?

Symptoms:

Import only gets partially done before failing. Avada informs me I probably need to adjust my PHP config.

After this, my site fails to load at newdomain.staging.tld, and instead falls back to primary.tld/staging/newdomain, which fails to load properly.

BasicAuth prompts occur twice, once at http://... and once at https://...

Solution:

Seems like something is causing requests at the staging site to fallback to the root sites .htaccess port 80 redirect rule.

I edited the newdomain.staging.tld/.htaccess to include the normal WP redirect rules:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

…but outside of the # BEGIN WordPress and # END WordPress comment tags.

Those rules were being removed during the import for some reason, and causing issues from that point on.

After the import completed, I was able to re-position the WP redirect block between the comment tags without any further issues.

By bo.

I'm @boyEatsSteak in a lot of places. I have been wanting 🍕 for weeks. I like gadgets and technology and keeping notes and tips for my future self since all I can remember is that I forget things.