Redirect Loop Installing WordPress on a Subdomain

Typically installing WordPress on a subdomain is no big deal. It’s a 10 minute process at most. However, today I needed to install it for a client’s test site and it would throw a Error 310 (net::ERR_TOO_MANY_REDIRECTS) — “This webpage has a redirect loop” or “The page isn’t redirecting properly” as soon as I pressed the “Install” button.

I tried clearing cache, cookies, testing on multiple browsers, etc. Nothing worked. Then I remembered the main domain has some really extreme code in the .htaccess file to secure the site. Sure enough I found the following in the file:

# Block the include-only files.
RewriteEngine On
RewriteBase /
RewriteRule ^wp-admin/includes/ - [F,L]
RewriteRule !^wp-includes/ - [S=3]
RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
RewriteRule ^wp-includes/theme-compat/ - [F,L]

Fix / Solution: Temporarily rename the .htaccess file to something like old.htaccess, quickly install WP on the subdomain, then change the file back. Hopefully this saves someone else a lot of time and headache.

Posted on April 24th, 2015 in WordPress.
Tagged: , , ,