Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

153
Vistas
Redirect multiple subdomains to different specific index.php files

i'm hosting different sites using the same domain. I would like to redirect each subdomain to different "index.php" Here is an example from what i want to do:

subdomain1.mydomain.com --> http://subdomain1.mydomain.com/subdomain1/index.php
subdomain2.mydomain.com --> http://subdomain2.mydomain.com/subdomain1/index.php

This is my file structure:

/var/www/
    '-- html
        |-- site1
            '-- index.php
        '-- site2
            '-- index.php

I've been trying to achiev this by using the ".htaccess" file, but i'm not getting there.

I know .htaccess isn't the only workaround. I may use javascrip or PHP script

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

you can use this code:

site1-->index.php code:

<?php
header('Location: http://subdomain2.mydomain.com/subdomain1/index.php');
?>

site2-->index.php code:

<?php
header('Location: http://subdomain1.mydomain.com/subdomain1/index.php');
?>
over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda