Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Limit File Types

Discussion in 'General Discussion' started by Doug E, Aug 8, 2009.

  1. Doug E

    Doug E Well-Known Member

    Aug 17, 2005
    Likes Received:
    Trophy Points:
    Is there a way to limit file types in an addon domain folder?

    Or some way to limit file types through htacess or anything like that?

    Say I want to give a folder on a domain to someone to use and access via ftp, but they can only use it for html and css files and files under a certain size limit.

    Anybody know if this is possible and how?
  2. thewebhosting

    thewebhosting Well-Known Member

    May 9, 2008
    Likes Received:
    Trophy Points:
    I do not think it will be possible to limit the file size for particular folder. However, you can try below code in .htaccess to limit file types for uploading.

    RewriteEngine On
    RewriteCond %{REQUEST_URI} foldername/
    RewriteCond %{REQUEST_URI} !\.(ext1|ext2|ext3|ext4|ext5)$ [NC]
    RewriteRule .* error-page.html [L]

    Note: Replace ext1, ext2..etc with the types of extensions you wish to disallow.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice