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

  • Moderators

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. :)

Link to comment
Share on other sites

  • Moderators

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

Link to comment
Share on other sites



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...