Jump to content

<p>Securing Files and Directories</p>


Nabeel
  • Securing of files and directories is an important thing any VA Admin should do. It's simple by creating a file in your webroot called .htaccess, placing the following in there:

    # Some basic security for phpVMS files
    # Thanks to mark1million
    
    Options All -Indexes 
    
    <FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$">
    Order Allow,Deny
    Deny from all
    </FilesMatch>
    

    You can also refer to this thread for more details

Securing Files and Directories


User Feedback

Recommended Comments

skymx

Posted

uhh.. I was the one who found this insecurity! (((its not a flaw is a feature?))) :lol:

Mysterious Pilot

Posted

Hum that works fine in UNIX environments but in Windows hosting you cannot create a file called .htaccess.

  • Moderators
mark1million

Posted

To stop leaching of your image files add this to the same file.

#disable hotlinking
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?PUT YOUR DOMAIN HERE/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?forum.phpvms.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?va-list.com/.*$ [NC]
RewriteRule \.(gif|png|jpg|js|css)$ - [F,NC]

Explained put your domain here is your website address, leave the ? so ?somedomain.com

If you want to allow other domains like i have then simply add them to the exception list.

phpvms and va-list.com, you can add as many as you like. :)

  • Moderators
Kyle

Posted

If anyone wants suggested HTACCESS file, This is the one for the best security so you won't have sneakers in your files.....

# main page of the site
DirectoryIndex index.php

# prevent viewing of a specific file
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$">
Order Allow,Deny
Deny from all
</FilesMatch>

# prevent viewing of index
Options -Indexes



Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...