320 posts
  • Bought between 100 and 499 items
  • Has been a member for 7-8 years
  • United States
timmylogue says

So I have a flash gallery that uses .xml to pull in images.

Is it possible to still allow the .xml file to grab images but if someone would happen to go to a direct hit for example,
could I make it forbidden?

I didn’t know if there was some kinda .php script that would allow me to do this. I thought I would give it a shot and ask on here.

Thanks Everyone. Tim

99 posts
  • Bought between 1 and 9 items
  • Referred between 1 and 9 users
  • Belgium
  • Sold between 10 000 and 50 000 dollars
  • Exclusive Author
  • Has been a member for 3-4 years
Lamovo says

PHP isn’t really the right tool to do this. What you need is some htaccess magic. http://altlab.com/htaccess_tutorial.html could help you out.

2964 posts
  • Football Contest Participant/Runner-up
  • Australia
  • Community Moderator
  • Elite Author
  • Author had a Free File of the Month
  • Most Wanted Bounty Winner
  • Author had a File in an Envato Bundle
  • Has been a member for 5-6 years
  • Contributed a Blog Post
+11 more
dtbaker Volunteer moderator says

A bit tricky, not really possible with htaccess on it’s own.

One solution is to write a php script to allow one time links, eg:


the 1kj135rl1k23j4 would only work once.

a million possible ways to do this, one way could be to generate your xml file with php, generate a unique hash for each image, store the hash > image relationship in a php session, then in image.php you lookup the hash and spit out the image, then remove the hash from the php session. visiting the url again wouldn’t work because the hash > image map doesn’t exist any more.

epic caching and other possible problems, but should be possible.