Les sous-domaines imbriqués sont-ils possibles avec un sous-domaine multisite?
-
-
Bien que cela soitpossible,celapeut compliquétrès vite,cependant,ceplugin (gratuit) https://wordpress.org/plugins/wp-multi-network/et ce (25,95 $) http://wpebooks.com/networks/vouspermettent defaire l'affaire.While it is possible, it can get complicated very quickly, however, this plugin (free) https://wordpress.org/plugins/wp-multi-network/ and this ($25.95) http://wpebooks.com/networks/ allow you to do the trick.
- 1
- 2014-04-09
- gmazzap
-
Merci @ G.M.S'il y a une chose queje redoute,c'est d'ajouterencore un autreplugin à un site Web.Heureusement,je n'aipasbesoin de domainesimbriqués aprèstout.Phew.Thanks @G.M. If there's one thing I dread it's adding yet another plugin to a website. Luckily I don't need nested domains after all. Phew.
- 0
- 2014-04-10
- Alexander Rechsteiner
-
1 réponses
- votes
-
- 2015-04-19
Àprésent,c'estpossible sans aucunplugin. WordPress vouspermet demodifier le domaineet le chemin d'un site sans aucune restriction unefois qu'ilest créé.
Tout d'abord: créez unnouveau site avec un sous-domaine arbitrairemais valide:
Unefois le site créé,suivez le lien »modifier le site« dans lemessage de confirmation. Ici,vouspouvezmodifier le domaineet/ou le cheminen votreproprenom. (Les règles de réécriturepar défaut d'uneinstallation de sous-domainene fonctionnentpas avec un chemin autre que
/
.) Dans votre cas,changez le domaineenen.site1.example.com
. Gardez également l'option »Mettre àjoursiteurl
ethome
.« Cochée!Bien sûr,vous devez vous assurer que le sous-domaine sera résolupar l'hôte conduisant votreinstallation WordPress. Dansmonexemple local (en.site1.wp.tmp),j'ai ajouté la ligne suivante aufichier/etc/hosts:
127.0.0.1 en.site1.wp.tmp
Votre site devraitmaintenant être accessible via
en.site1.example.com
(ou dansmonexempleen.site1.wp.tmp
):Si vous avezmodifié l'URL d'un site avec du contenuexistant,vous souhaiterezpeut-êtremettre àjour les références à l'ancienne URL dans labase de données WordPress. Vouspouvez utiliser wp-cli pour cela:
wp search-replace en-site1.example.com en.site1.example.com --network --precise --dry-run
Le
--dry-run
vous donne un aperçu des colonnes dutableau qui seront affectées sans rien changer. Après avoir sauvegardé vos donnéeset vérifié votreparamètre,exécutez la commande sans ceparamètre.By now, it is possible without any plugin. WordPress allows you to edit a sites domain and path free of any restrictions once it is created.
First of all: create a new site with an arbitrary but valid subdomain:
After the site was created follow the »edit site« link in the confirmation message. Here you can alter the domain and/or path on your own behalf. (The default rewrite rules of a sub-domain install does not work with a path other than
/
.) In your case change the domain toen.site1.example.com
. Keep the option »Updatesiteurl
andhome
as well.« checked!Of course, you have to make sure that the subdomain will be resolved to the host driving your WordPress install. In my local example (en.site1.wp.tmp) I added the following line to the /etc/hosts file:
127.0.0.1 en.site1.wp.tmp
Now your site should be accessible via
en.site1.example.com
(or in my exampleen.site1.wp.tmp
):If you changed the URL of a site with existing content, you might want to update references to the old URL in the WordPress database. You can use wp-cli for that:
wp search-replace en-site1.example.com en.site1.example.com --network --precise --dry-run
The
--dry-run
gives you an overview of the table columns that will be affected without actually changing anything. After you backed up your data, and you double-checked your parameter, run the command without this parameter.
J'ai actuellement unmultisite utilisant la configuration de sous-domaines,quifonctionnebien jusqu'àprésent:
La questionestmaintenant de savoir s'ilestpossible d'ajouter unnouveau site distinct à l'aide de l'URL
Lorsquej'essaye de créer le site dansmon réseau,j'obtiens l'erreur
Lemultisiteest-il conçupourfonctionner avec une configuration comme celle-ci?