Jump to content

.htaccess help please


jokerfool

Recommended Posts

Can someone shed some light on my htaccess file and tell me the best way to prevent people from uploading any type of file please. Here is the file, isn't this already telling the server to not allow these file types to be uploaded, yet somehow they're still allowed too, im totally confused and any help would be appreciated please, thank you.

 

Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{REQUEST_METHOD} ^PUT$ [OR] 
RewriteCond %{REQUEST_METHOD} ^MOVE$
RewriteRule ^/(.*)\.php /files/$1.nophp
RewriteRule ^/(.*)\.html /files/$2.nohtml
RewriteRule ^/(.*)\.htm /files/$3.nohtm
RewriteRule ^/(.*)\.doc /files/$4.nodoc
RewriteRule ^/(.*)\.txt /files/$5.notxt
RewriteRule ^/(.*)\.tpl /files/$6.notpl
RewriteRule ^/(.*)\.csv /files/$7.nocsv
RewriteRule ^/(.*)\.exe /files/$8.noexe
RewriteRule ^/(.*)\.dll /files/$9.nodll

Link to comment
Share on other sites

After a quick google, It appears, the file uploads are allowed, but the file extension would be changed according to the rules you set in your htaccess file. So .php files would get a .nophp extension instead, this keeps them from being executed on the server.

 

Does that aspect of the .htaccess work on your server??

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.