0

I'm getting Error 500 on my new subdomain. I'm aware that there are multiple steps to resolving this issue (there's a lot of support on this issue in stackoverflow), but before I proceed with troubleshooting, I first want to be sure that the code is correct.

Here is the last part of my wp-config.php (this includes what I added to the file):

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);

define( 'WP_ALLOW_MULTISITE', true );

define('MULTISITE', true);
define('SUBDOMAIN_INSTALL', true);
define('DOMAIN_CURRENT_SITE', 'mydomain.com');
define('PATH_CURRENT_SITE', '/');
define('SITE_ID_CURRENT_SITE', 1);
define('BLOG_ID_CURRENT_SITE', 1);
define('WP_ALLOW_REPAIR', true);

/* That's all, stop editing! Happy blogging. */

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__) . '/');

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

// define( 'WP_CRON_LOCK_TIMEOUT', 120   ); 
// define( 'AUTOSAVE_INTERVAL',    300   );
// define( 'WP_POST_REVISIONS',    5     );
// define( 'EMPTY_TRASH_DAYS',     7     );
define( 'WP_AUTO_UPDATE_CORE',  true  );

I feel quite confident about the wp-config.php file, but less so about the changes I made to the .htaccess file. Here is the entire .htaccess file:

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 24 hours"
    ExpiresByType image/jpeg "access plus 24 hours"
    ExpiresByType image/gif "access plus 24 hours"
    ExpiresByType image/png "access plus 24 hours"
    ExpiresByType text/css "access plus 24 hours"
    ExpiresByType application/pdf "access plus 1 week"
    ExpiresByType text/javascript "access plus 24 hours"
    ExpiresByType text/html "access plus 5 minutes"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 24 hours"
</IfModule>
<ifModule mod_headers.c>
Header set X-Endurance-Cache-Level "2"
</ifModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Ballot169)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
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]

What I don't quite get about the .htaccess file is that it says to replace the rules: Multisite Network Admin WordPress As you can see in my .htaccess posted above, all I did was add this code to the end. Am I supposed to overwrite the existing rules? If so, which rules do I overwrite?

I would greatly appreciate it if someone could look these two files over and tell me if they are correct or not. And if not, how to fix my code. This way, I'll know if I can proceed with the rest of the troubleshooting steps (with resources such as: 500 error for new site in multisite wordpress)

45a7e29
  • 21
  • 2
  • are you able to access frontend ? or having issue with both frontend and backend? – wpdevloper_j Jun 08 '21 at 09:45
  • Hi @wpdevloper_j I'm not so fluent in the jargon but I believe I get the gist of your question. I can access the backend; multisite appears fully functional on my WP dashboard. I have added the subdomain using my host provider, BlueHost. And as admin, I have access to Cpanel. The frontend... when I open my new site (subdomain url) I get Error 500. BlueHost Support has been unable to help me thus far; they have signaled to me difficulty in accessing the backend since they don't work with Multisite. They were able to resolve Error 500 for me once, but then got Error 404. Now it's Error 500 again – 45a7e29 Jun 08 '21 at 13:02
  • i think there might be some issue with server – wpdevloper_j Jun 08 '21 at 13:12
  • Ok. I appreciate your insight @wpdevloper_j I will go back to BlueHost and troubleshoot with them again. And my next step in troubleshooting on my own is to look at the wildcard subdomain... but first, about my original post, my code in wp-config and .htaccess looks good? Thank you in advance – 45a7e29 Jun 08 '21 at 14:48
  • Just an update: I played around with the wildcard (I did as suggested by @amota here: https://stackoverflow.com/questions/20400685/500-error-for-new-site-in-multisite-wordpress) and now I am no longer getting Error 500, but now error 404... I am chatting with BlueHost support now – 45a7e29 Jun 08 '21 at 15:33

0 Answers0