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

226
Vistas
redirect direct image if not used in image tag

We have some static images, publicly available. However, we want to be able to redirect that images if not used in image tag, ex:

http://server.com/img/my_cool_image.jpg

i want to if some one open it directly with that link it will be redirect to the home page http://server.com but if that were used in image(src) tag it will opened normaly

<img src="http://server.com/img/my_cool_image.jpg">

is threre any way to do something like that? Thanks.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You need to check HTTP_REFERER. If refer is set that means it is not direct access using manual input in browser address bar. HTTP_REFERER is the way to know where the comes from (previous page/site, etc)

if(!isset($_SERVER['HTTP_REFERER'])) {
   redirect('http://server.com');
}
over 4 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda