• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

136
Vistas
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]
about 3 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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]
about 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda