prevent *.bak *.inc file upload from a apache server -


is possible prevent people seeing files .bak apache directory ? if there request url (http://foo.com/bar.bak), it'd have 404 error, , prevent upload file.

now know answer, here : 1 of them use rewriterule in httpd.conf. – cedric 14 secs ago edit know answer, here : 1 of them use rewriterule in httpd.conf.

rewriteengine on # turn on rewriting engine rewriterule  rewriterule   ^(.*(\.(html|htm|gif|js|jpg|jpeg|php|css)|\/))$    $1  [l,nc] # not (no rewriting), don't execute next rule #("nc", tells apache rule should case-insensitive, , "l" tells apache not process more rules if 1 used.)  rewriterule   ^.*$    /  [nc,r] # rewrite other urls / 

this main idea. please, modify first regex needs ! (as urls foo?bar=obu won't work, nor foo/bar)


Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -