Welcome to the E-Blah Community!
We would like to welcome you to our community and invite you to register an account or login.
Being a registered member is important, as it gives you several advantages over the normal Guest status. After registering you will be able to download files and images, post messages, and access member-only portions of the forum - just to name a few. Registration is quick and simple, and only takes about a minute of your time.

E-Blah Community    General Discussion    Chit - Chat  ›  htaccess?
Users Browsing Forum
No Members and 1 Guests

htaccess?  This thread currently has 233 views. Print
1 Pages 1 Recommend Thread
mealybar
May 8, 2006, 6:31am Report to Moderator Report to Moderator

E-Blah Member
Posts: 190
Gender: Male
Posts Per Day: 0.08
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 16 hours 24 minutes
Location: England
Age: 25
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
Logged Offline
Private Message Private message
Justin
May 8, 2006, 8:54am Report to Moderator Report to Moderator

The E-Blah Developer
E-Blah Programmer
Posts: 15,196
Gender: Male
Posts Per Day: 4.37
Reputation: 93.25%
Reputation Score: +304 / -22
Time Online: 37 days 19 hours 48 minutes
Location: Tallassee, AL
Age: 25
Just put something like, <?php if($passedvariable == '') { echo "No access"; return; } ?> before everything.  That'll make it not display anything if you didn't set $passedvariable before it loaded.


I do installs for $25 and upgrades for $20.
Technical support is always free.

  Donate to E-Blah!  

My Websites: Revolution Reality (My Blog)  | Portfolio

"But you, O Lord, are a compassionate and gracious God, slow to anger, abounding in love and faithfulness." — Psalm 86:15 NIV
Logged Offline
Site Site Private Message Private message Reply: 1 - 8
mealybar
May 10, 2006, 4:57am Report to Moderator Report to Moderator

E-Blah Member
Posts: 190
Gender: Male
Posts Per Day: 0.08
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 16 hours 24 minutes
Location: England
Age: 25
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
Logged Offline
Private Message Private message Reply: 2 - 8
Martin
May 10, 2006, 5:50am Report to Moderator Report to Moderator

I love E-Blah
10 Series Support Team
Posts: 5,171
Gender: Male
Posts Per Day: 1.98
Reputation: 98.41%
Reputation Score: +247 / -4
Time Online: 39 days 9 hours 4 minutes
Location: UK
Age: 53
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
Logged
Site Site Private Message Private message Reply: 3 - 8
mealybar
May 11, 2006, 11:47am Report to Moderator Report to Moderator

E-Blah Member
Posts: 190
Gender: Male
Posts Per Day: 0.08
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 16 hours 24 minutes
Location: England
Age: 25
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
Logged Offline
Private Message Private message Reply: 4 - 8
Martin
May 11, 2006, 1:15pm Report to Moderator Report to Moderator

I love E-Blah
10 Series Support Team
Posts: 5,171
Gender: Male
Posts Per Day: 1.98
Reputation: 98.41%
Reputation Score: +247 / -4
Time Online: 39 days 9 hours 4 minutes
Location: UK
Age: 53
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
Logged
Site Site Private Message Private message Reply: 5 - 8
mealybar
May 12, 2006, 10:13pm Report to Moderator Report to Moderator

E-Blah Member
Posts: 190
Gender: Male
Posts Per Day: 0.08
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 16 hours 24 minutes
Location: England
Age: 25
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
Logged Offline
Private Message Private message Reply: 6 - 8
Martin
May 13, 2006, 2:35am Report to Moderator Report to Moderator

I love E-Blah
10 Series Support Team
Posts: 5,171
Gender: Male
Posts Per Day: 1.98
Reputation: 98.41%
Reputation Score: +247 / -4
Time Online: 39 days 9 hours 4 minutes
Location: UK
Age: 53
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
Logged
Site Site Private Message Private message Reply: 7 - 8
mealybar
May 15, 2006, 5:19pm Report to Moderator Report to Moderator

E-Blah Member
Posts: 190
Gender: Male
Posts Per Day: 0.08
Reputation: 100.00%
Reputation Score: +2 / -0
Time Online: 3 days 16 hours 24 minutes
Location: England
Age: 25
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
Logged Offline
Private Message Private message Reply: 8 - 8
1 Pages 1 Recommend Thread
Print

E-Blah Community    General Discussion    Chit - Chat  ›  htaccess?