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

229
Vistas
Multipage setup same code basis but different config file

We currently have a mutltisite setup of more than 20 sudomains for customers. The same codebase is used for all sites, let's just say it is located in the folder /srv/code. Apache's root directory points to it as well.

Now we have to create a folder under /var/www/subdomain for each subdomain and put a configuration file called config.ini there.

How do I tell Apache now when the PHP script searches for the file config.ini that it can find it here: /var/www/subdomain ? And is it the best solution ever?

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

0

Is this a shared host? If yes, you should first check if a script inside /srv/code is allowed to access a file in /var/www/subdomain.

You can extract the domain the current script was called via from $_SERVER['SERVER_NAME']. You can then use this information to extract the subdomain from it and access the config.ini in the correct directory.

This is probably easier then doing it in Apache.

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