Si tienes varios blogs en Wordpress, seguramente los tienes separados cada uno en una instalación distinta. Y seguro debe ser todo un martirio tener que actualizar cada uno cuando salen nuevas versiones.
Sin embargo, con un pequeño hack, es posible mantener varios blogs con una sola instalación, y a continuación te muestro cómo.
Haz que cada dominio (o subdominio) que quieras para cada blog apunte al mismo directorio en tu hosting. Para eso tendrás que ver la configuración de servidores virtuales en tu servidor, o usar wildcard subdomains.
Haciendo uso de la información que obtiene el servidor de cual ha sido el nombre de dominio por el que ha accedido el usuario (con $_SERVER['SERVER_NAME']), podremos determinar que blog presentarle.
Abre el fichero wp-config.php, que es donde se configura la base de datos, usuario y password. Y copia lo siguiente (cambiando la configuración por la tuya donde corresponda):
<?php $sitename = strtolower( $_SERVER['SERVER_NAME'] ); if ( substr( $sitename, 0, 4 ) == 'www.' ) { $sitename = substr( $sitename, 4 ); } switch ( $sitename ) { case 'example.com': define('DB_NAME', 'database'); define('DB_USER', 'dbuser'); define('DB_PASSWORD', 'dbpassword'); define('DB_HOST', 'localhost'); define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); $table_prefix = 'blog1_'; define ('WPLANG', 'es_PE'); break; case 'juanperez.example.com': define('DB_NAME', 'juanperezdb'); define('DB_USER', 'juanperez'); define('DB_PASSWORD', 'jpass'); define('DB_HOST', 'localhost'); define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); $table_prefix = 'wp_'; define ('WPLANG', 'es_PE'); break; case 'defaulthost.com': default: define('DB_NAME', 'anotherdb'); define('DB_USER', 'anotheruser'); define('DB_PASSWORD', 'anotherpass'); define('DB_HOST', 'anotherhost.net'); define('DB_CHARSET', 'utf8'); define('DB_COLLATE', ''); $table_prefix = 'blog3_'; define ('WPLANG', 'en_GB'); break; } define('ABSPATH', dirname(__FILE__).'/'); require_once(ABSPATH.'wp-settings.php'); ?>
De esta manera se puede configurar cada sitio, ya sea que sean dominios distintos o subdominios, o también que utilicen la misma base de datos o una distinta (aunque si usan la misma, deberán cambiar el $table_prefix para que no utilicen las tablas de otro blog.
Por último, deberás configurar que cada blog utilice un subdirectorio distinto para sus uploads para evitar mayores problemas entre ellos.
Podrán utilizar desde cualquiera de los blogs todos los temas y plugins que tengas instalado. Pero cuidado con los plugins que guardan información en archivos en lugar de la base de datos.
Comentarios
Que bien
Que interesante, voy a probarlo.
Buena Voz
jeje se que hace tiempo colocaste este post, pero recien lo puse en practica y funciona a las mil maravillas :P
Duda sobre instalación
Hola, quiero tener varios blogs en una misma instalación de wordpress. El servidor es mi ordenador, y en mi wp-config me pone lo siguiente:
<?php
// ** Configuracion de MySQL ** //
define('DB_NAME', 'prueba'); // el nombre de la base de datos
define('DB_USER', 'root'); // tu nombre de usuario de MySQL
define('DB_PASSWORD', ''); // ...y tu contraseña
define('DB_HOST', 'localhost'); // hay un 99% de probabilidades de que no necesites cambiar esto
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
// Define cada clave secreta con una frase aleatoria distinta. No tendrás que recordarlas más,
// así que utiliza unas largas y complicadas. Puedes inventarlas tú o bien visitar
// http://api.wordpress.org/secret-key/1.1/ para conseguir claves secretas generadas automáticamente.
define('AUTH_KEY', Cambia esto por tu frase aleatoria'); // Cambia esto por tu frase aleatoria.
define('SECURE_AUTH_KEY', Cambia esto por tu frase aleatoria'); // Cambia esto por tu frase aleatoria.
define('LOGGED_IN_KEY', Cambia esto por tu frase aleatoria'); // Cambia esto por tu frase aleatoria.
// Cambia el prefijo si deseas instalar multiples blogs en una sola base de datos.
$table_prefix = 'wp_'; // Solo números, letras y guiones bajos
// Cambia lo siguiente para traducir el WordPress. El correspondiente archivo MO
// del lenguaje elegido debe encontrarse en wp-content/languages.
// Por ejemplo, instala ca_ES.mo copiándolo a wp-content/languages y define WPLANG como 'ca_ES'
// para traducir WordPress al catalán.
define ('WPLANG', 'es_ES');
/* No edites desde aqui */
if ( !defined('ABSPATH') )
define('ABSPATH', dirname(__FILE__) . '/');
require_once(ABSPATH . 'wp-settings.php');
?>
¿Solo tengo que cambiar el prefijo para volver a instalar o como esta el tema?
Soy nueva en esto y necesito ayuda.
Saludos
Solo tienes que ponerle un
Solo tienes que ponerle un prefijo distinto a cada blog para que no se crucen, cada uno va a tener sus propias tablas.
Como es todo en un solo servidor de base de datos, podrías incluso hacer el switch solamente con el prefijo así:
// primero todo lo que no cambia:
define('DB_NAME', 'database');
define('DB_USER', 'dbuser');
define('DB_PASSWORD', 'dbpassword');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
define ('WPLANG', 'es_PE');
$sitename = strtolower( $_SERVER['SERVER_NAME'] );
if ( substr( $sitename, 0, 4 ) == 'www.' ) {
$sitename = substr( $sitename, 4 );
}
switch ( $sitename ) {
case 'example.com':
$table_prefix = 'ex_';
break;
case 'juanperez.example.com':
$table_prefix = 'juan_');
break;
default:
$table_prefix = 'wp_');
}
// luego todo lo que sigue....
La cuestión de los uploads es
La cuestión de los uploads es muy delicada, porque aun después de la instalación el admin de cada blog puede cambiar la ruta. Yo creo que lo ideal seria forzar una ruta predeterminada desde el archivo de configuración (wp-config.php) del mismo modo que se ha cambiado el prefix de las tablas o la base de datos, estoy seguro que los creadores de WP se han reservado alguna constante para ello.
Saludos ...
phentermine 37 5mg or
phentermine 37 5mg or phentermine overnight or no prescription phentermine or cheap phentermine diet pill or buy phentermine online
long term side effects of
long term side effects of phentermine or phentermine no prescription or phentermine 6 pm order or phentermine with no prescription or phentermine no rx
no prescription phentermine
no prescription phentermine or cheap phentermine no prescription or card master no phentermine prescription or buy phentermine without prescription or phentermine dosage
phentermine or phentermine no
phentermine or phentermine no prescription or adipex phentermine vs or online phentermine or phentermine directory
phentermine prescription or
phentermine prescription or phentermine weight loss or phentermine very cheap or buy phentermine no prescription or phentermine cheap no prescription
phentermine online no rx or
phentermine online no rx or card master no phentermine prescription or long term phentermine use or extra cheap phentermine or buy cheap phentermine online
phentermine prescription or
phentermine prescription or phentermine without prescription or phentermine free shipping or phentermine hcl or phentermine side effects dangers
phentermine or cheap
phentermine or cheap phentermine free shipping or phentermine 37 5mg or buy phentermine or cheapest phentermine online
phentermine prescription or
phentermine prescription or cheapest phentermine or card master no phentermine prescription or phentermine cheap no prescription or card master no phentermine prescription
phentermine and
phentermine and methamphetamine or buy phentermine online or cheap 37 5 phentermine or discount phentermine or strongest phentermine
online phentermine or
online phentermine or phentermine diet pills or phentermine yellow or buy phentermine or phentermine forum
online phentermine or
online phentermine or phentermine side effects or cheap phentermine or phentermine without rx or where can i purchase phentermine
no prescription phentermine
no prescription phentermine or low cost phentermine or phentermine side effects or phentermine without prescription or phentermine for sale
online phentermine or
online phentermine or phentermine ingredient or buy phentermine online or phentermine phentermine or phentermine 37.5 mg
order phentermine or
order phentermine or phentermine information or phentermine blue or wholesale phentermine or mg buy phentermine
phentermine cod or
phentermine cod or phentermine no script or generic phentermine or phentermine online pharmacy or buy phentermine online
negative side effects of
negative side effects of phentermine or phentermine 30mg or abuse phentermine or blue phentermine 30mg or phentermine side effects
phentermine forums or card
phentermine forums or card master no phentermine prescription or phentermine review or phentermine pill or phentermine
phentermine 37 5mg or
phentermine 37 5mg or phentermine prescription or side effects of taking phentermine or phentermine or phentermine mg
phentermine capsule or cheap
phentermine capsule or cheap phentermine no rx or buy cheap phentermine or buy phentermine online or phentermine
difference between adipex and
difference between adipex and phentermine or buy phentermine mg or phentermine 37 5mg or phentermine no prescription or no prescription phentermine
phentermine no prescription
phentermine no prescription or no prescription phentermine or lowest price for phentermine or phentermine without prescription or buy phentermine
phentermine or phentermine 37
phentermine or phentermine 37 5mg or phentermine adipex or buy phentermine or herbal phentermine
cheap phentermine without a
cheap phentermine without a prescription or phentermine no prescription needed or order phentermine online or discount phentermine or phentermine online without prescription
cheap phentermine or
cheap phentermine or phentermine on sale or negative side effects from phentermine or discount phentermine online or cheap phentermine
Enviar un comentario nuevo