|
|
mealybar |
|
|
Posts: 189
Gender:  Male
Posts Per Day: 0.16
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 15 hours 10 minutes
Location: England
Age: 22
|
Hi, I notice in blah/Code a htaccess file which stops anyone viewing the code (right?) however the server is still able to use the code. I'm trying to do the same for my php include files, which for some reason I gave a unique extension (.pbxi). I dont want anyone to see the contents, which at the moment comes up as plain text if you know the url, but I want my scripts still to be able to use the files. If I add an application type to my extension, php, it would list a blank page for a file of functions; or I could deny all like you have. However I cant get either to work! I tried adding your .htaccess file from the Code directory, but that also stopped the server accessing the files. I tried "Addhandler application/x-httpd-php .html .php" but that seems to do nothing at all! Any ideas?  Richard |
|
|
|
|
|
Justin |
|
|
Posts: 15,070
Gender:  Male
Posts Per Day: 6.55
Reputation: 93.40%
Reputation Score: +297 / -21
Time Online: 36 days 23 hours 14 minutes
Location: Tallassee, AL
Age: 22
|
|
|
|
|
|
mealybar |
|
|
Posts: 189
Gender:  Male
Posts Per Day: 0.16
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 15 hours 10 minutes
Location: England
Age: 22
|
I dont have a variable to pass, and its only a list of functions. I could change the extension to .php but I've have to modify a number of files  I just wondered if you (or anyone) knew a way to either stop access to everything other than the server, or to add an extension to the php handler. Could you tell me how your 'deny all' htaccess works, i.e. lets server to use the script but error's everyone else? Richard |
|
|
|
|
|
Martin |
|
|
Posts: 4,558
Gender:  Male
Posts Per Day: 3.16
Reputation: 98.60%
Reputation Score: +211 / -3
Time Online: 35 days 19 hours 17 minutes
Location: UK
Age: 50
|
To block all files with a certain file name extension, put this into your .htaccess file:
|
Code
<FilesMatch "\.ext$"> deny from all </FilesMatch>
|
|
Change ext to the file extension you wish to block. To block one specific file, put this into your .htaccess file:
|
Code
<FilesMatch "^filename\.ext$"> deny from all </FilesMatch>
|
|
Change filename\.ext to the name of the file you wish to block. (Escape all periods in the file name with a "\" backward slash character.) (An .htaccess file effects the directory where the .htaccess file is located and all of that directory's subdirectories.) |
| Martin's Reputation: Increase |
|
|
|
|
|
mealybar |
|
|
Posts: 189
Gender:  Male
Posts Per Day: 0.16
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 15 hours 10 minutes
Location: England
Age: 22
|
Thanks Martin. Just tried that, but it wont allow my scripts to include the files. I'm using php require to include them. However the 403 error comes up when you try and access them. Half way there   Richard |
|
|
|
|
|
Martin |
|
|
Posts: 4,558
Gender:  Male
Posts Per Day: 3.16
Reputation: 98.60%
Reputation Score: +211 / -3
Time Online: 35 days 19 hours 17 minutes
Location: UK
Age: 50
|
If you know the ip address of your server you could try:
Order Deny, Allow Deny From All Allow From 142.3
(142.3 being the start of your servers ip) |
| Martin's Reputation: Increase |
|
|
|
|
|
mealybar |
|
|
Posts: 189
Gender:  Male
Posts Per Day: 0.16
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 15 hours 10 minutes
Location: England
Age: 22
|
Hi, This is really confusing me now,,, my scripts still cant open the file, I've checked the server ip a number of times and using $SERVER variable to check its the same one to my domian. I looked into parsing the custom extention files as php, which worked (they were parsed as php) but wouldnt allow scripts on the same server, in the same folder(!) to use them!! I've just tried to change the extensions to .php, however I remember why I made them custom now (!!) as the will include fine, issuing a echo when I check they are nested and included correctly, however all of my functions in these files come back as function undefined! So  ,,, clutching at straws now,,, would CHMOD settings help me out in any way? P.S. I dont understand how the eblah/Code directory htaccess file 'deny all' still allows that directory contents to be used by the server, and that the same config doesnt work for php files??!! Ahh..lol |
|
|
|
|
|
Martin |
|
|
Posts: 4,558
Gender:  Male
Posts Per Day: 3.16
Reputation: 98.60%
Reputation Score: +211 / -3
Time Online: 35 days 19 hours 17 minutes
Location: UK
Age: 50
|
Here's another shot.
<FilesMatch "\.(pbx1)$"> Order Deny, Allow Deny From All Allow From 142.3 </FilesMatch>
Again, change the 142.3 |
| Martin's Reputation: Increase |
|
|
|
|
|
mealybar |
|
|
Posts: 189
Gender:  Male
Posts Per Day: 0.16
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 15 hours 10 minutes
Location: England
Age: 22
|
No that didnt work either  Since then, I've been trying to change my files to .php and including them. However, that doesnt work either! It simply wont take an include ' http://....../myfile.php', but would take without a hitch include ' http://....../myfile.txt' --> the files are exactly the same, but the extension change. This hasnt got me puzzeled anymore, its got me p###...lol |
|
|
|
|
|
|