Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

430
Views
.htaccess Access-Control-Allow-Origin no permite dominios específicos

Desde mi host local, intenté acceder a un archivo llamado fonts.css, que importa fuentes.

Cuando agrego el fragmento a mi css, aparece el siguiente error:

 No 'Access-Control-Allow-Origin' header is present on the requested resource.

archivo CSS:

 @import "http://drupal-site.lndo.site:8000/fonts.css?timestamp=22222231";

Como solución alternativa, probé lo siguiente dentro del .htaccess:

 SetEnvIf Origin "^http(s)?://(.+\.)?(localhost:4200|domain1\.com:5100|domain2\.com)$" origin_is=$0 Header always set Access-Control-Allow-Origin %{origin_is}e env=origin_is

Cuando intento la misma solicitud, sigo recibiendo el mismo error CORS.

¿Cómo puedo incluir dominios en la lista blanca usando declaraciones if dentro del archivo .htaccess?

Intenté esto:

 <IfModule mod_headers.c> <If "req('Host') == 'localhost:4200'"> RedirectMatch (.*) http://www.wooga.com$1 Header set Access-Control-Allow-Origin localhost:4200 </If> </IfModule>
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!