2

I've installed a WordPress Network using subdomains on an existing install, to make an english version of my current site (in french), but I get a 404 error on the new subdomain site. If I create a subdomain myself via ftp the subdomain is found in the browser but wordpress doesn't see it (and if I've understood, wordpress doesn't need an actual subdomain folder as it will make a virtual one in the database).

I've tried modifying the DNS with help from someone on the WP forum (https://wordpress.org/support/topic/multi-site-install-original-site-is-fine-500-error-on-the-new-subdomain/) but no success so far; he suggested I try here. It seems likely the problem lies with the server (Apache/2.4.10 (Ubuntu)), but I can't access the server at my hosting company and the support there says they can't either, and that I should modify the htaccess.

I need to set up ideally a wildcard subdomain "*" or else a subdomain called "en" which will go to the folder where my wordpress install is, called "www". The wildcard subdomain was already set up in the DNS and should also be on the server, but I have no way of checking (or creating it).

What should I add to the htaccess to tell the server to send all subdomains to the wordpress install ? (Or alternately is there something else I should do ?)

Currently the htaccess contains this:

# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On 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] </IfModule> # END WordPress 

These are my current DNS settings. "bobo" is a test subdomain. DNS

Here is a screenshot of the server via ftp. The wordpress install is inside the www folder, according to the instructions from my host. ftp

Let me know what other information you might need.

I am not a dev but I can modify the htaccess and upload it via ftp. I just have no clue what to write in it. I can modify the DNS as well, if necessary. My host (online.net) doesn't use CPanel. I have access to some admin tools on their site.

Any help is greatly appreciated.

9
  • "create a subdomain myself via ftp" - How do you "create a subdomain via FTP"?! "...but I have no way of checking (or creating it)." - if you are getting a 404 (presumably from your site?) then the wildcard subdomain would seem to already be set up correctly as far as the server is concerned? Commented Oct 6, 2018 at 23:38
  • I created a folder via ftp, it's one of the methods proposed by my host (online.net). You can see the folder in the screencap of my ftp (in the original post). However this is not the right method for wordpress, as the subdomain will be managed in the database. My original site is fine ; but when I try to access the newly-created site in the subdomain, I can't. To be clear, the 404 error is on the wordpress dashboard of the new subdomain site. Commented Oct 9, 2018 at 15:51
  • By the way I've created a new subdomain site in the Network dashboard WITHOUT creating a folder via ftp, I am getting a 500 error on the dashboard for that site: "The domain / subdomain has not been found. Error 500." Commented Oct 9, 2018 at 16:38
  • "I created a folder via ftp" - Creating a folder has nothing to do with creating a subdomain. (?) And neither does a subdomain need a specific folder. If you are using WP with subdomains then I don't think you should have separate subdirectories (for the subdomains to point to) - all the subdomains should point to the same place on the filesystem so that the WP front-controller can manage them all. Commented Oct 9, 2018 at 17:00
  • 1
    Thanks MrWhite for reply. My host specifically references ftp subdomains (documentation.online.net/fr/web/domain-name/…) so I used the same term thinking it had something to do w/ their server config. They also told me to configure the htaccess for wildcard subdomains. It turns out they are not a reliable source of information, and the reason I was having problems is because wordpress multi-support is simply not supported there. I am switching to a new host instead (ovh). I'll keep the wp stack for ref. Commented Oct 10, 2018 at 17:31

1 Answer 1

1

For WordPress multi-site you don't want the subdomain to point to a subdirectory off the document root - which would seem to be the problem here. As you state in your question, you need the subdomain to point to the document root (the www subdirectory) where WordPress multi-site is installed.

All that is required is the * CNAME entry in DNS (which seems to already be configured from the information you linked to) and a wildcard entry in your server config of the form:

ServerAlias *.example.com 

If the "wildcard" ServerAlias is not defined and you are forced to have subdomains that map to same-name subdirectories off the document root then that would seem to be the problem.


Just to reiterate what I mentioned in comments... you can't create subdomains using an FTP client. All you're doing is creating a subdirectory. If the host (online.net) is automagically mapping (wildcard) subdomains to subdirectories of the same name (off the document root) then this would seem to be unique to your host.

1
  • 1
    Thanks MrWhite for these details. It turns out that my host does not allow the necessary server configuration so my problem is down to the fact that it's just not possible there. It's annoying they couldn't give me better info earlier because I lost a week trying to figure this out and in fact the only solution is, switch to a different host. :/ I'm going with OVH instead of online, from the research I've done apparently there is no problem with the server config there. Hopefully this will all be sorted as soon as I migrate. Commented Oct 11, 2018 at 13:43

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.