iNoize Posted June 21, 2016 Posted June 21, 2016 Hello, Option 1 doesnt really work for me https://processwire.com/api/modules/multi-site-support/ on pw 3.0.22 I have an installation. I copy the Site folder and call it site-de if i modyfi the index.config.php eg function ProcessWireHostSiteConfig() { return array( /* * Some Examples (you should remove/replace them if used). * Just note that the values must begin with 'site-'. * */ 'de.mydomain.com' => 'site-de' // 'www.mydomain.com' => 'site-mydomain', // 'dev.mydomain.com' => 'site-dev', // 'www.otherdomain.com' => 'site-other', /* * Default for all others (typically /site/) * */ '*' => 'site', ); } but i see only blank page or error 404 " 404 page not found (no site configuration or install.php available) " whats the Problem ? Or how to handle this on pw 3.0.22 Thanks
kongondo Posted June 21, 2016 Posted June 21, 2016 Haven't tried in PW 3.X but going by your 'no install.php' available, why do you need that again? Haven't you already installed site-de?
iNoize Posted June 22, 2016 Author Posted June 22, 2016 Okay currentky it works but dont know thats right, i see on de.mydomain.com one version of site on dev.mydomain.de the base version (other DB) of my site. Do i have alvays to install a new version or i can copy the site-de to site-en, site-pl ..... and create copys of the DB ? I have to login in each version seperatly ? Its only same core that the installation use ? So i can update the core an once but have uptodate the modules seperatly ? Greetz
kongondo Posted June 22, 2016 Posted June 22, 2016 (edited) Yes, you can copy over sites. The important things are: Correct db credentials in /site/config.php Correct array entries in index.config.php Correct salt value in /site/config.php (not 100% sure but I think good if salt values are different for different sites; not necessary, but good) Yes, logins are separate. If you want one login use 'multi-site option 2'. Yes, same core; update once, enjoy everywhere is the advantage here. Edit: I am assuming that those sites being copied over have previously been installed (i.e. there is a /site/assets/installed.php) Edited June 22, 2016 by kongondo clarity 1
iNoize Posted June 22, 2016 Author Posted June 22, 2016 Thaks a lot, is it possible to detect the land and switch to right subdomain ? Are there some Modules or Snippets what I can use ?
flydev Posted June 22, 2016 Posted June 22, 2016 7 hours ago, iNoize said: Thaks a lot, is it possible to detect the land and switch to right subdomain ? Are there some Modules or Snippets what I can use ? You might use a simple code which check the HTTP_ACCEPT_LANGUAGE server variable like the following snippet : <?php $userLocale = locale_accept_from_http($_SERVER['HTTP_ACCEPT_LANGUAGE']); switch ($userLocale){ case "de": // deusth $session->redirect("http://de.mydomain.com"); break; case "en": // english $session->redirect("http://en.mydomain.com"); break; case "fr": // french $session->redirect("http://fr.mydomain.com"); break; default: // default locale/page : english $session->redirect("http://en.mydomain.com"); break; } 1
LostKobrakai Posted June 22, 2016 Posted June 22, 2016 Just keep in mind to maybe also check for a cookie or something, otherwise this will prevent users from manually switching to another subdomain / language. 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now