Autor Tema: Crear subdominios  (Leído 1164 veces)

Desconectado Eduardo

  • PHPer@
  • **
  • Mensajes: 69
  • Karma: 1
  • Sexo: Masculino
    • Ver Perfil
    • Nuxsoft
Crear subdominios
« en: 09 de Mayo de 2007, 07:16:08 am »
Hola tengo varios dominis y quisiera ofrecer subdominios gratis e buscado y buscado y ningun me ha servido hoy encontre este:

<?
#####################################################################
#  Subdomains 0,51
#  Released under the terms of the GNU General Public License.
#  Please refer to the README file for more information.
#####################################################################

#####################################################################
#  PLEASE EDIT THE FOLLOWING VARIABLES:
#####################################################################

# Your domain name. NO "www." IN FRONT OF IT. NO SLASHES ("/").
# Just the actual domain name, i.e. "yourdomain.com"
$domain = "ogt.at";

# The default page that the visitors should be redirected to if
# they don't request a sub domain or they request a non-existing
# sub domain. This page could be named "welcome.html",
# "front_page.html" or something similar. The page should be
# located in your document root. If you can view the page by
# entering "http://yourdomain.com/welcome.html" in your browser,
# then it is located in the document root.
$default_page = "index.php";

# Do you want to use frames?
$use_frames = "yes";

#####################################################################
#  THAT'S IT! NO MORE EDITING NECESSARY.
#####################################################################



$underdomaene = $HTTP_HOST;
$underdomaene = eregi_replace("\.".$domain, "", $underdomaene);
$underdomaene = eregi_replace("www\.", "", $underdomaene);
$underdomaene = strtolower($underdomaene);

# If the sub domain is the name of a directory in the document root...
if (is_dir("$DOCUMENT_ROOT/$underdomaene")) {
   # The frames version:
   if ($use_frames == "yes") {
      echo "<html><head><title>$domain/$underdomaene</title>\n\n";
      echo "<!---------------------------------------------------------------------\n";
      echo "   The sub domains at $domain were created using\n";
      echo "   the PHP script \"Subdomains\"\n";
      echo "---------------------------------------------------------------------->\n\n";
      echo "</head>\n\n\n\n";
      echo "<frameset cols=100%,* frameborder=no border=0 framespacing=0>\n";
      echo "<frame src=http://$domain/$underdomaene>\n";
      echo "<noframes>\n";
      echo "<body bgcolor=black link=silver alink=black vlink=gray>\n";
      echo "<font face=helvetica color=white><center>\n";
      echo "This page uses frames, but it seems that your browser does not support this feature.\n";
      echo "To move on, click here:<br><a href=http://$domain/$underdomaene>$domain/$underdomaene</a>\n";
      echo "</center></font>\n";
      echo "</body>\n";
      echo "</noframes>\n";
      echo "</frameset></html>\n";
   }

   # The non-frames version:
   else {
      header("Location: http://$domain/$underdomaene");
   }
}

# If the sub domain is NOT the name of a directory in the document root...
else {
   if (!$REQUEST_URI || $REQUEST_URI == "/") {
      include("$DOCUMENT_ROOT/$default_page");
   }
   else {
      header("Location: http://$domain$REQUEST_URI");
   }
}
?>

lo subo y no pasa nada quisiera ver si alguien me pudiera ayudar.

Saludos!
Eduardo Saldana
Nuxsoft - Servicios Web
Hosting, Reseller, Streaming, Servidores Dedicados, VPS, Licencias, Registry .MX
--

Comunidad PHPeros

Crear subdominios
« en: 09 de Mayo de 2007, 07:16:08 am »

Desconectado naveda

  • Administrador General
  • PHPero Master
  • *****
  • Mensajes: 2.282
  • Karma: 165
  • Sexo: Masculino
    • Ver Perfil
    • naveda.me
Re: Crear subdominios
« Respuesta #1 en: 09 de Mayo de 2007, 18:14:45 pm »
Según lo que veo este codigo no crea subdominios... Parece ser que hace una lista de los subdominios o algo así :S
Creo que no has encontrado lo que buscabas ;)

Mira aquí ;)
Por favor, leete las Normas


Desconectado Eduardo

  • PHPer@
  • **
  • Mensajes: 69
  • Karma: 1
  • Sexo: Masculino
    • Ver Perfil
    • Nuxsoft
Re: Crear subdominios
« Respuesta #2 en: 09 de Mayo de 2007, 20:48:17 pm »
Ya habia intentado con ese pero nada... =S

Miralo: http://espacio.cn/cpanel_subdomains.php

Si quieres los datos dime y te los envio por MP
« Última modificación: 09 de Mayo de 2007, 20:56:03 pm por Eddie50 »
Eduardo Saldana
Nuxsoft - Servicios Web
Hosting, Reseller, Streaming, Servidores Dedicados, VPS, Licencias, Registry .MX
--

Desconectado CarlosRdrz

  • Moderador Global
  • PHPero Master
  • *****
  • Mensajes: 2.505
  • Karma: 131
  • Sexo: Masculino
  • A.k.a. TLX
    • Ver Perfil
Re: Crear subdominios
« Respuesta #3 en: 27 de Mayo de 2007, 15:09:05 pm »
Lo tienes mal configurado
Tu index verdadero, llamalo inicio.php
por lo tanto pon en
$default_page = "index.php";
pon inicio.php

Luego crea un archivo que se llame index.php y pon en su contenido ese codigo, ya esta, entra a la pagina y listo
La dedicación de mi respuesta sera directamente proporcional a la dedicación de tu pregunta.
Hacer códigos que entiendan las máquinas es fácil, lo difícil y realmente útil es hacer códigos que entiendan las personas.
http://twitter.com/CarlosRdrz
http://www.carlosrdrz.es