Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

230
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda