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

236
Vistas
How to redirect through htaccess without changing the URL?

I am currently using the code below to point all subdomains to their document root.

RewriteCond %{HTTP_HOST} ^(.*)\.example\.co [NC]
RewriteRule ^(.*)/?$ http://example.co/%1/$1 [P]

subdomain.example.co will point to example.co/subdomain but the URL will remain untouched.

The problem with this is that when you try to retrieve the URL, through PHP, it will always return example.co/subdomain despite the fact that the URL bar displays it as a subdomain. I believe this is due to the Proxy flag.

How could I achieve the same effect but allow for the actual URL that the user is on (the subdomain) to be retrieved?

Overall

  • allsubdomains.example.co should point to example.co/allsubdomains

  • The URL should remain as allsubdomains.example.co

  • When retrieving the current URL through PHP, it should return allsubdomains.example.co

over 4 years ago · Santiago Trujillo
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