What I did here, is create an .htaccess in every sub-directory of the /var/www directory.It usually shouldn't be like so, but this is just for the sake of the example

Comparing the directory structure with the configuration, it means that all .htaccess files inside in the /var/www folder and its sub-directories, excluding the /var/www/uploads directory and its sub-directories, can override all kinds of directives.

But /var/www/uploads and its sub-directories can only use the .htaccess file to override the Allow, Deny and Order directives.

Note: As of apache 2.4 (Which is available by default in 13.10+) the Allow, Deny and Order directives were replaced by a single directive named Require.

there is no file named default - but there is a file named 000-default.conf
– Tahir YasinOct 27 '15 at 12:19

1

+1 for reminding to enable the rewrite, i was missing this and couldn't figure out why its not working after doing all the stuff.
– Abdul MannanApr 29 '16 at 10:01

This comment refers to the configuration of Apache 2.2, not 2.4. In 2.4, the default file is called 000-default.conf, and it doesn't contain the AllowOverride None line.
– ben_nuttallJun 23 '16 at 13:55

the file is 000-default.conf and it's not possible to add AllowOverride None here, if you reload apache give error
– KrekerNov 14 '16 at 14:58

If all you need is to allow mod_rewrite directives to be overridden in .htaccess, its better to use AllowOverride FileInfo. Although FileInfo already includes a large set of directives, you would still be restricting lots of directives from being overridden.
– DanFeb 1 '18 at 11:31

Although this may have fixed your problem, it is not related to the question the OP has. The order and allow directives are directives in apache2.2 and earlier. They are used to allow/deny access to users on certain directories. They don't have any impact on whether the directives in a .htaccess file would be parsed or not.
– DanJun 13 '17 at 13:55