FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free Frihost Account!


How to...easilly protect your directories within your site..





gidevelop
To protect a directory that is in your site, like include dir for instance, the easyest way is to build an empty index file. something like index.php/htm/html or any other extension you want

Example tree

Code:
www/
     include/
             index.php  [blank file]
     index.php


when a user will try to browse that directory through FIREFOX [this little brat is displaying de directory contain if unprotected] will get a blank page. you could let there a message something like "in your dreams a@@#$%e".

WARNING!! - This kind of protection is not so secure also but is better then nothing .

Hope it helps!
Diablosblizz
You can also change your indexing to "NO-INDEXING". Work's just as well, and you only have to make one 404.shtml. Very Happy
sonam
He, he, you can improve your blank page with this few php lines and redirect on your home page. In that case file extension is .php

Code:
<?php
    header("Location:http://my_site.com");  //change my_site.com in your site URL
   exit;
?>


Sonam
maeglin20
Code:
<?
   header("Location: ../index.php");
   die();
?>
gidevelop
I now all the methods you mentioned. There are good.. but i was post this...POST for the beginners of the beginners. Thanks for your help..and if you get new ideeas post them here
Related topics
password coding help
500- Internal Server Error - DONT START NEW THREADS
5 minute download wait
Robots.txt
private HTML
protecting a file with htaccess
How do I make a password...
How to password protect windows directories?
Problem accessing private files
How to protect a server/site from DOS attack?
What's your biggest SEO surprise?
klasöre parola
Great article about security best practice
Password Protected Directories
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.