Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
Redirigir múltiples subdominios a diferentes archivos index.php específicos

Estoy alojando diferentes sitios usando el mismo dominio. Me gustaría redirigir cada subdominio a un "index.php" diferente. Aquí hay un ejemplo de lo que quiero hacer:

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

Esta es mi estructura de archivos:

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

He estado tratando de lograr esto usando el archivo ".htaccess", pero no lo logro.

Sé que .htaccess no es la única solución. Puedo usar script javascrip o PHP

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

puedes usar este código:

sitio1-->index.php código:

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

sitio2-->index.php código:

 <?php header('Location: http://subdomain1.mydomain.com/subdomain1/index.php'); ?>
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!