WordPress install is preventing access to non word press subdomains

Avatar
  • updated
  • Answered

I have recently set up a WordPress site http://www.prime.net.nz, with all files installed in a subfolder: http://www.prime.net.nz/prime


My wp-config file has the following entries


define( ‘WP_ALLOW_MULTISITE’, true );


define(‘MULTISITE’, true);


define(‘SUBDOMAIN_INSTALL’, true);


define(‘DOMAIN_CURRENT_SITE’, ‘www.prime.net.nz’);


define(‘PATH_CURRENT_SITE’, ‘/’);


define(‘SITE_ID_CURRENT_SITE’, 1);


define(‘BLOG_ID_CURRENT_SITE’, 1);


I have other unrelated (non wordpress) websites in other subfolders of prime.net.nz – for example Xcloner is installed in http://www.prime.net.nz/xcloner – and that is the url that has always worked until now.


Since setting up the wordpress site, however my other subfolders have now become inaccessible via browser. It appears all subdirectories within http://www.prime.net.nz are being captured by wordpress somehow, not just the intended folder http://www.prime.net.nz/prime – so when I type http://www.prime.net.nz/xcloner in my browser, I now get an error 404 warning page as generated by the wordpress site.


How can I prevent unrelated directories being ‘captured’ or redirected (if that is what is happening) along with the one intended WordPress sub directory?


I have no redirects set up in my host Cpanel


Note, I have tried replacing the wp-config line define(‘PATH_CURRENT_SITE’, ‘/’); withdefine(‘PATH_CURRENT_SITE’, ‘/prime’) – this seems not to make any difference to behaviour of my other sub folders when typed as urls in a browser – all still get redirected to the error 404 page within the wordpress installation. However a side effect is that I can no longer log in to http://www.prime.net.nz/wp-admin – I get an error message in the WP admin login dialog saying ‘cookies have been disabled’ for my domain.


I definitely still want anyone just typing my root domain to get to the wordpress site , while retaining the ability to access the non wordpress sites

Avatar
Arn
Hello, Sorry for the problem with accessing your domains after installing WordPress with multisite enabled. By default, WordPress always puts in an entry in the .htaccess file. If you look at that file you can see the redirect added by WordPress. You can comment it out or rename the .htaccess file temporarily to see if that is the cause of the issue. WordPress requires a domain name in order to operate. If you're trying to assign it to the root of your domain, then it will definitely anything previously using the domain name. If you want to have a subdomain using the root domain, you would have to add an exception rule in the .htaccess file. You also can't have something auto-generated in WordPress to use that same URL. So you will need to be careful in how you're naming your pages in the WordPress site. If you remove your WordPress site and then re-install it with a different domain name, then you can also avoid this entirely. I hope this helps to clear it up. You may also be interested in checking WordPress plugins such as the WordPress Multisite domain mapping that can help you with redirecting without having to edit the .htaccess file. If you have any further questions, please let us know. Kindest regards, Arnel C.