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

223
Views
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 answers
Answer question

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 Report
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!