Forum Moderators: phranque

Message Too Old, No Replies

htaccess deny/allow with php include

         

webstyler

8:03 am on Oct 31, 2006 (gmt 0)

10+ Year Member



Hi

I have 1 file .inc that contain a php class and that must be included from other sites.

The file must be a .inc files

But, If I visit link where is a class I can view on browser the code.

So

I need to allow access only to site/s that included the .inc

I have try with host and ip in the htaccess but don't work

Order Deny,Allow
Deny from all
Allow from siteallow.com

I think the problem is this:
I open the browser and visit site A that "include" class on site B (where there is htaccess)
BUT htaccess check MY ip/hostname and NOT ip/hostname of site that contain include... possible?

thxx

jd01

7:26 pm on Oct 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't have a solution for you, except to say, "go the other way".

Put a call to the file on the other server rather than the file. If you are running it the way you are because you need to other server to process the file rather than your server, there is a way to force the remote server to process a locally hosted php file. Let me know if you need to know how.

Justin

Added: Practicallity of include depends on file size, server settings, blah.