Typically installing WordPress on a subdomain is no big deal. It’s a 10 minute process at most. However, today we 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 the the “Install” button was pressed.
We tried clearing cache, cookies, testing on multiple browsers, etc. Nothing worked. Then we remembered the main domain has some really extreme code in the .htaccess file to secure the site. Sure enough, the following was found 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.