WP-Mix

A fresh mix of code snippets and tutorials

Limit HTTP Request Size

This .htaccess snippet can be used to restrict the total size of the HTTP request body sent from the client.

# LIMIT REQUEST SIZE
# 10485760 = 10 megabytes
# 5242880  = 5 megabytes
# 3145728  = 3 megabytes
# 2097152  = 2 megabytes
LimitRequestBody 5242880

Note that the first five lines are commented out with a #, and are included for reference only (it helps to not have to lookup common byte conversions). The actual directive that limits the request size is on the last line, which currently limits requests to 5 MB (i.e., 5242880 Bytes).

See also: Set PHP Limits with .htaccess

References

Learn more

.htaccess made easy