Preventing type-in access to URL - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-13-2008, 10:19 AM   #1 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 3
Default Preventing type-in access to URL

Hello to all.
This is my issue: I created several directories with pictures in one domain.
In another domain i created links pointing to my picture´s folders.
I want to only allow access to those folders if the person comes from the links i mentioned. I don´t want type-in access to those folders.
I tried some hotlink protection with .htaccess, but they don´t protect from type-in.
Any suggestions? Thanks a lot guys.
grevan is offline   Reply With Quote
Sponsored Links
Old 11-13-2008, 02:21 PM   #2 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 5
Default Re: Preventing type-in access to URL

Maybe you should show these files via a script? Write a small php script to do the following and just use that, in combination with .htaccess, to not allow direct access.

PHP Code:
//something like..
  
header("Content-type: image/gif");
  
readfile("/path/to/image.gif");
  exit(
0); 
then set your .htaccess to redirect on anything that is not an image OR store the images outside of public view.
webguy1620 is offline   Reply With Quote
Old 11-13-2008, 02:50 PM   #3 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 3
Default Re: Preventing type-in access to URL

Thanks webguy for the hint, i´m not a programmer, should i place the script inside my pictures pages or the link page? Can you give me an example?
Thanks a lot.
grevan is offline   Reply With Quote
Old 11-13-2008, 03:11 PM   #4 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 5
Default Re: Preventing type-in access to URL

On second thought, did you try something like this in your .htaccess:

Code:
RewriteRule \.(jpg|jpeg|png|gif)$ http://www.yourdomain.com/hotlink.gif [NC,R,L]
This will show that same image in place of any direct access to other images in that directory.
webguy1620 is offline   Reply With Quote
Old 11-13-2008, 03:23 PM   #5 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 3
Default Re: Preventing type-in access to URL

Just tried and it´s not preventing direct access.
grevan is offline   Reply With Quote
Old 11-13-2008, 03:55 PM   #6 (permalink)
Junior Member
 
Join Date: Nov 2008
Posts: 5
Default Re: Preventing type-in access to URL

Can you please reply with the contents of your .htaccess
webguy1620 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 07:28 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting