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

155
Visualizações
subdomain to sub folder mapping

e.g. my subdomain is abc.example.com

my folder is /htdocs/abcfiles

my requirement is when i accessing the url http://abc.example.com. it will display the webpage from "abcfiles/" folder.

my .htaccess file

RewriteEngine On
RewriteCond %{HTTP_HOST} ^abc.example.com$
RewriteCond %{REQUEST_URI} !^/abcfiles/
RewriteRule (.*) /abcfiles/$1 [L]
RewriteBase /abcfiles/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /abcfiles/index.php [L]

Its working but "/abcfiles/" showing in some links. i.e abc.example.com/abcfiles/...

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You can have this code in site root .htaccess:

RewriteEngine On

# if /abcfiles/ is in URL then remove it
RewriteCond %{THE_REQUEST} \s/abcfiles/(\S*) [NC]
RewriteRule ^ /%1 [L,NE,R=301]

# if hostname starts with abc. then route the request to abcfiles/
RewriteCond %{HTTP_HOST} ^abc\. [NC]
RewriteCond %{REQUEST_URI} !^/abcfiles/ [NC]
RewriteRule (.*) abcfiles/$1 [L]

Have this code in abcfiles/.htaccess:

RewriteEngine On

RewriteRule ^index\.php$ - [L,NC]

# route every request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
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