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

181
Visualizações
Apache rewrite rule for removing part of the directory from the url

I have the following testing sites set up with apache and served from the following place /htdocs/www/*:

https://local.sweetcar.com/www/mycompany/
https://local.sweetcar.com/www/sweetcar/

I would like to configure an apache rewrite to serve the following urls

https://local.mycompany.com/
https://local.sweetcar.com/

So the www/mycompany/ and the www/sweetcar/ is removed from the url while everything else is preserved

This is what I tried with no success:

.htaccess

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You may use these rules in site root .htaccess:

RewriteEngine On
RewriteBase /

RewriteCond %{ENV:REDIRECT_STATUS} !200
RewriteCond %{HTTP_HOST} ^local\.([^.]+)\. [NC]
RewriteRule !^www/ www/%1%{REQUEST_URI} [L,NC]

RewriteRule ^index\.php$ - [L]
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