PDA

View Full Version : .htaccess file creation help



alev
09-16-2008, 11:50 AM
Hi
I have folder with php application running.
It use to be a somewhat a guesst book, but the purpose for it is to a site owner incert data weekly.
It was OK for a while but now it get's vendalized by some JERK with all kind of GARBAGE.
I create a htaccess file and will incert in to a folder and I need that file to be activated as soon as some one try to incert a comment,but the rest of the files in this folder should not to be effected.

here is a .htaccess sample
AuthUserFile /home/name/www/folder/subfolder/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
AuthName "Data Incert "
<LIMIT GET POST>
require valid-user
</LIMIT>

and .tpasswd sample:
admin:$1$xbMWZk6L$bpEspwv/d6aP.lrljYq3z.



My question is how to have this work only with the file let say incert.php and do not apply to any other file in this foder..


Thanx in advance


alev

mhJr_
09-16-2008, 08:00 PM
Hi
I have folder with php application running.
It use to be a somewhat a guesst book, but the purpose for it is to a site owner incert data weekly.
It was OK for a while but now it get's vendalized by some JERK with all kind of GARBAGE.
I create a htaccess file and will incert in to a folder and I need that file to be activated as soon as some one try to incert a comment,but the rest of the files in this folder should not to be effected.

here is a .htaccess sample
AuthUserFile /home/name/www/folder/subfolder/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
AuthName "Data Incert "
<LIMIT GET POST>
require valid-user
</LIMIT>

and .tpasswd sample:
admin:$1$xbMWZk6L$bpEspwv/d6aP.lrljYq3z.



My question is how to have this work only with the file let say incert.php and do not apply to any other file in this foder..


Thanx in advance


alev http://www.avxf.com/img18.jpg


<Files ".ht*">
order allow,deny
deny from all
</Files>

<Files incert.php>
AuthUserFile /home/pathto/.htpasswd
AuthType Basic
AuthName "Please Login"
Require valid-user
</Files>

You can use * wildcards in file names to match multiple files.

If you are familiar with regular expressions, you can replace the Files directive with FilesMatch.

I believe something as above might work for you. GL!

alev
09-17-2008, 09:10 AM
mhJr_ Thanx for your help
Fotunately I had done it last night .
Some times u need to read a little.

Agaie thanx every one for your hel

alev