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

205
Vistas
Setting up redirect on .htaccess after configuring httpd.conf fails

Please, I have check multiple threads on stackoverflow but it is a nightmare to understand what is going wrong.

I have setup .../example.com.conf with ServerAlias as *.example.com which i believe would make my canonical name match any subdomain.

Also, I have implemented redirect rule in .htaccess so visit to bar.example.com or foo.example.com would redirect to domain.com for some reason it just doesn't work.

For some obscure reasons I do not know why www.example.com works perfectly. Please do I need to work on the A records? or do something? Note: Include /etc/httpd/custom.d/mcb.conf I just blocked some bots so and user-agents

I'm providing my exact configure of both files below... I appreciate the help in advance, guiding me what I'm doing wrongly.

example.com.conf

<VirtualHost *:80>
    ServerName example1.com
    ServerAlias *.example1.com
    ServerAdmin webmaster@example1.com
    DocumentRoot /var/www/example1.com/public_html

    <Directory /var/www/example1.com/public_html>
        Options +FollowSymLinks
        AllowOverride All
        Include /etc/httpd/custom.d/mcb.conf
    </Directory>

    ErrorLog /var/log/httpd/example1.com-error.log
    CustomLog /var/log/httpd/example1.com-access.log combined
</VirtualHost>

.htaccess

<IfModule mod_rewrite.c>
   RewriteEngine on
   RewriteCond %{HTTP_HOST} ^(.*)\.example1\.com [NC]
   RewriteRule ^(.*)$ http://domain-for-example.com/$1 [R=301,L]
</IfModule>
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