Jump to content

restrict access


John Smith

Recommended Posts

hey guys umm

so i got my site, and i can upload files like for example in folder test and put image test1.png in the folder and

then i can access the image by typing in my browser mysite.com/test/test1.png and the image will be shown

but i have a question:

how can i restrict the file so that people can't use browser links to locate the file, but that fetchRemote can still download the image? is there a way? i just want that only my server can access some of my files on my websites

i dont want somebody to discover my secret files and then simply download them (e.g images)

Link to comment

Yeah..

some programs/sites store their secret data like images or something on their private server

though even if you had the path to that secret data, on browser it would simply deny the access or wouldn't load at all

so i want that i can access files with fetchRemote, but accessing the file with browser should be blocked

and idk how to rly do that xD

Link to comment
Just edit your .htaccess to allow only one ip

order deny,allow 
deny from all 
allow from 1.2.3.4 

where is 1.2.3.4 you put the server ip.

I didn't originally have .htaccess file, so i created it and i put this, but i can still access anything with my browser

is there any other way to do this?i don't know why doesn't this work..

Link to comment
I didn't originally have .htaccess file, so i created it and i put this, but i can still access anything with my browser

is there any other way to do this?i don't know why doesn't this work..

are you sure you typed the correct name (.htaccess) and your webserver is Apache?

Link to comment
I didn't originally have .htaccess file, so i created it and i put this, but i can still access anything with my browser

is there any other way to do this?i don't know why doesn't this work..

are you sure you typed the correct name (.htaccess) and your webserver is Apache?

Yes.

I don't know whether this could cause the issue, but let me explain how is my website setup

I got my own domain, i pointed the domain towards my vps ip (so e.g mydomain.com redirects you to vps ip)

on vps(debian 8 ) i have folder /var/www/html

in html folder i place anything related to the site (e.g index.html file which loads when you visit e.g mydomain.com)

however originally there hasn't been that .htaccess file, so i created it and used your lines of (code?)

I don't really know why doesn't this work. I got apache service installed on my vps

But the VPS shouldn't be the problem, many websites run on a vps or a dedicated server

this forum might be the completely wrong place to ask this kind of questions, but i thought that there might be someone who knows this things, if anyone knows how i could solve this or where i can ask for help regarding this, please tell me

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...