IPB

Welcome Guest ( Log In | Register )



Tags
This content has not been tagged yet
 
Reply to this topicStart new topic

I Need Help To Use Htaccess To Allow Only My Server To See A Directory


shadowx
no avatar
Look around, what do you see? Incorrect.
***********
Group: [HOSTED]
Posts: 1,324
Joined: 12-April 06
From: Essex, UK
Member No.: 21,719
Spam Patrol
myCENT:32.70



Post #1 post Aug 29 2006, 11:23 AM
Hi everyone

Ive finally got a bit of an opportunity to do some php coding for an organisation which shouldnt be too hard. But i want to have some php files which will be used as includes in another php script but for added protection i dont want these php files to be visible by the public. I know i can use htaccess to easilly hide these files but what im worried about is will the head script be able to see the includes it needs if the htaccess file is hiding the entire directory?

Obviously its no good if not even the local server can see its own scripts and i havent used htaccess properly before and i just wondered if i did use it to hide the includes directory will the first script still be able to access and include them correctly?

Thanks
Go to the top of the page
+Quote Post
rvalkass
no avatar
apt-get moo
****************
Group: [MODERATOR]
Posts: 2,714
Joined: 28-May 05
From: Devon, England
Member No.: 7,593
Spam Patrol
myCENT:62.10



Post #2 post Aug 29 2006, 12:08 PM
When you say you don't want them visible, do you mean in a directory listing? If so, just add a blank index.htm file into the directory so a listing can't appear. This does mean that if people know the file name they can still open the file, but all they'll get is the HTML output, not the PHP code. As for using an .htaccess file, I'm not sure if PHP will still be able to access the files, as I tend not to use .htaccess much now.
Go to the top of the page
+Quote Post
electriic ink
no avatar
Incest is a game the whole family can play.
***********
Group: [MODERATOR]
Posts: 1,239
Joined: 11-February 05
From: Heaven
Member No.: 3,709
myCENT:59.86



Post #3 post Aug 29 2006, 12:24 PM
If you don't want people to see or execute them then you don't need .htaccess, you can do it using php. It's a more compucated way than using .htaccess so you should only use this method if no-one can provide you with the .htaccess answer:
  1. Put this piece of code at the top of all files in the includes directory:

    CODE
    <? if (empty($permit)) {
                                                    exit (' You do not have permission to see this file! ');

                   } ?>

  2. At the beginning of each file which which requires the include files, place:

    CODE
    <? $permit = 'Yes'; ?>

Unfortuneately, I know little of .htaccess but I'll try and see if I can find anything on google....
Go to the top of the page
+Quote Post
shadowx
no avatar
Look around, what do you see? Incorrect.
***********
Group: [HOSTED]
Posts: 1,324
Joined: 12-April 06
From: Essex, UK
Member No.: 21,719
Spam Patrol
myCENT:32.70



Post #4 post Aug 30 2006, 07:19 PM
Thanks for the suggestions, ill use the php method if i cant find a htaccess one, ill have a look myself as this is the first chance ive had to use the computer since i posted.

Maybe the htaccess method is very illusive or non exsistent ohmy.gif
Go to the top of the page
+Quote Post
CrazyRob
no avatar
ITS ALIVE.....MUHHHAAAA
*********
Group: Members
Posts: 534
Joined: 17-October 05
From: Chippenham UK
Member No.: 13,031
myCENT:63.10



Post #5 post Aug 30 2006, 07:51 PM
therre is a much simpler way than that all you need to do is encode them in IonCube or Zend and install the ioncube loaders or zend laoders on your server then oly your server will be able to esxactue them and the php files will be encrypted if taken off the server.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

    Topic Title Replies Topic Starter Views Last Action
No New Posts   0 OpaQue 17,183 9th September 2004 - 08:40 AM
Last post by: OpaQue
No New Posts   6 outwarsecrets 10,683 27th October 2009 - 08:09 AM
Last post by: NxTGaming
No New Posts   9 Panzer 2,655 4th January 2007 - 08:52 PM
Last post by: fffanatics
No New Posts   7 Raptrex 13,188 27th August 2004 - 11:16 PM
Last post by: Spectre
No New Posts 3 NuHoaXuLa 9,220 17th November 2006 - 08:33 AM
Last post by: farsiscript
No New Posts   0 sekundar 1,548 26th July 2006 - 07:35 AM
Last post by: sekundar
No New Posts   1 truvu17 8,357 21st September 2004 - 09:12 AM
Last post by: OpaQue
No New Posts   0 aoehq 1,862 17th March 2007 - 06:20 AM
Last post by: aoehq
No New Posts   1 BCD 150 3rd September 2009 - 09:28 PM
Last post by: truefusion
No New Posts   3 X3r0X 4,652 1st October 2004 - 08:16 AM
Last post by: X3r0X
No New Posts   2 Bimboadmasministries 9,597 9th July 2009 - 09:33 AM
Last post by: iG-Chémi ichi
No New Posts   0 Bimboadmasministries 6,396 8th October 2004 - 11:55 AM
Last post by: Bimboadmasministries
No new   16 newbie_dhkt 20,102 9th February 2009 - 09:30 PM
Last post by: Lightning73
No New Posts   4 sithslayer 3,932 14th December 2008 - 02:29 PM
Last post by: sithslayer
No New Posts   5 DMA 7,600 9th February 2009 - 10:05 AM
Last post by: aloKNsh


 



RSS Open Discussion Time is now: 8th November 2009 - 02:30 PM

Web Hosting Powered by ComputingHost.com.