Invision Power Services: Prevent Direct Access - Invision Power Services

Jump to content

Computing & Technology Forum Rules

Our community chat forum areas are for off-topic discussion only. Please do not post topics about IPS or its products and services here. We provide other forum areas for IPS discussion.

Do you need technical support on IPS products or services?

You can obtain support via the client area, or you can try to obtain peer-to-peer support at IPS Resources.

Did you find a bug in one of our products?

If you believe you've found a bug please post it to the bug tracker.

Have a suggestion or feedback?

Use the company feedback forum or appropriate product feedback forum. You can also submit a ticket in your client area if it's a private matter.
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Prevent Direct Access Rate Topic: -----

#1 User is offline   Invision User Icon

  • IPB Full Member
  • PipPipPip
  • View blog
  • Group: Members
  • Posts: 177
  • Joined: 17-December 05

Posted 27 December 2005 - 07:18 PM

Is there a way to make a directory hosted on a server unaccessible but still let it be included in other PHP files?

Thanks. :)
0

#2 User is offline   Sebastian Mares Icon

  • Needs Hobby
  • PipPipPipPipPipPipPip
  • View blog
  • Group: Members
  • Posts: 4,439
  • Joined: 27-May 03
  • Location:Bad Herrenalb, Germany

Posted 27 December 2005 - 07:27 PM

Wouldn't it work with a .htaccess file that denies access to all? AFAIK, PHP reads the files from disk and won't interefere with Apache.
There are 10 types of people in this world: those who understand binary, and those who don't.
0

#3 User is offline   Invision User Icon

  • IPB Full Member
  • PipPipPip
  • View blog
  • Group: Members
  • Posts: 177
  • Joined: 17-December 05

Posted 27 December 2005 - 07:33 PM

Okay, .htaccess is fine. How would I go about using that though please?

*.htaccess confuses me*
0

#4 User is offline   Sebastian Mares Icon

  • Needs Hobby
  • PipPipPipPipPipPipPip
  • View blog
  • Group: Members
  • Posts: 4,439
  • Joined: 27-May 03
  • Location:Bad Herrenalb, Germany

Posted 27 December 2005 - 07:40 PM

Simply create a file called ".htaccess" and write the following inside it:

Order Deny,Allow
Deny from all


Store the file inside the directory you want to protect.
There are 10 types of people in this world: those who understand binary, and those who don't.
0

#5 User is offline   Invision User Icon

  • IPB Full Member
  • PipPipPip
  • View blog
  • Group: Members
  • Posts: 177
  • Joined: 17-December 05

Posted 27 December 2005 - 07:42 PM

Thank you very much. :D

It doesn't seem to work. o__o
0

#6 User is offline   Sebastian Mares Icon

  • Needs Hobby
  • PipPipPipPipPipPipPip
  • View blog
  • Group: Members
  • Posts: 4,439
  • Joined: 27-May 03
  • Location:Bad Herrenalb, Germany

Posted 27 December 2005 - 08:03 PM

Do you even have Apache running as web server? And are .htaccess files parsed by your Apache?
There are 10 types of people in this world: those who understand binary, and those who don't.
0

#7 User is offline   Invision User Icon

  • IPB Full Member
  • PipPipPip
  • View blog
  • Group: Members
  • Posts: 177
  • Joined: 17-December 05

Posted 27 December 2005 - 08:07 PM

I do have an Apache server, yes.
0

#8 User is offline   Brendon Koz Icon

  • Needs Hobby
  • PipPipPipPipPipPipPip
  • View blog
  • Group: Members
  • Posts: 4,741
  • Joined: 06-September 03
  • Location:Saratoga Springs, NY, USA

Posted 27 December 2005 - 09:42 PM

You can place the folders/files BELOW your web root directory. I am doing this right now.

So, for instance, on my test machine...

C:\Apache\htdocs\*.*
The *.* are all files that are accessible, htdocs is my web root.

C:\Apache\php_secure\*.*
In this case I can still access the files one folder below (../ <-- relative url or path) but no one can view the files.
Posted Image
mysiteonline.org™
They say, "Practice makes perfect," yet they also say, "Nobody's perfect"... I don't get it.
0

#9 User is offline   Michael P Icon

  • PCA
  • Icon
  • View blog
  • View gallery
  • Group: +Active Customers
  • Posts: 2,222
  • Joined: 15-February 05
  • Location:Newcastle, UK.

Posted 27 December 2005 - 10:51 PM

View PostMatt Pullen, on Dec 27 2005, 07:18 PM, said:

Is there a way to make a directory hosted on a server unaccessible but still let it be included in other PHP files?

Thanks. :)


This may not be what your looking for exactly, but I use it, and its used in IPB.

In your scripts that will use the files in the protected directory, define a variable e.g. ScriptName, then in each script you will include in another folder, get the script to check the variable is defined, if its included the variable is defined, otherwise its not and you can get it to report an error message or even redirect to an access denied page. :)
0

#10 User is offline   _ Icon

  • Needs Serious Help
  • PipPipPipPipPipPip
  • View blog
  • Group: Members
  • Posts: 1,655
  • Joined: 09-December 03

Posted 27 December 2005 - 11:13 PM

I'd do what malikyte says; I place all my core files in /home/veracon, then the executor and static files in /home/veracon/public_html...
Posted Image
(colours are based on your IP address and almost* unique)
(* meaning that two bytes are left unused, and there's always the chance of a collision)
0

#11 User is offline   Brendon Koz Icon

  • Needs Hobby
  • PipPipPipPipPipPipPip
  • View blog
  • Group: Members
  • Posts: 4,741
  • Joined: 06-September 03
  • Location:Saratoga Springs, NY, USA

Posted 28 December 2005 - 01:35 AM

Without losing your password or host's security being bypassed, it's the most secure method of hiding your stuff.

I do basically the same thing on our production server (Unix OS) but figured a Windows OS example would be a bit more easily understood... :D
Posted Image
mysiteonline.org™
They say, "Practice makes perfect," yet they also say, "Nobody's perfect"... I don't get it.
0

#12 User is offline   Invision User Icon

  • IPB Full Member
  • PipPipPip
  • View blog
  • Group: Members
  • Posts: 177
  • Joined: 17-December 05

Posted 28 December 2005 - 07:58 AM

Okay! Thanks a bunch for that. :)
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users