Question: I have been trying to add rules like the following to the /etc/apache2/apache.conf file but they havent been noticed, whereas if I add them to the individual .htaccess files they are obeyed and anyone trying to access a readme.html file will be redirected.. I have added the followng rules but none of they are noticed including the ServerSignature ServerTokens ones.. the OS is debian 7 wheezy

```
ServerSignature Off
ServerTokens Prod

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteRule readme\.html? - [NC,F]
    RewriteRule changelog\.txt? - [NC,F]
</IfModule>

```

Answer: 
*If you have virtual hosts*, note that by default Rewrite configurations are not inherited by virtual hosts. In order to "inherit" the directives in the vHost configurations, each vHost configuration needs:

```
RewriteEngine on
RewriteOptions Inherit

```

See the [Apache documentation for the `RewriteOptions` directive](http://httpd.apache.org/docs/2.4/mod/mod_rewrite.html#rewriteoptions) for more detail.

To deny these two files server wide, without using `mod_rewrite`, you can also use a [`<FilesMatch>` container](http://httpd.apache.org/docs/2.4/mod/core.html#filesmatch) with the appropriate access control directive. 

For Apache 2.4:

```
<FilesMatch "(readme\.html|changelog\.txt)$">
  Require all denied
</FilesMatch>

```
First off I am not understanding what you are trying to redirect but first off the rewrite rules for each web site (vhost) is where the redirects should be added and of those redirects are permanent you should be doing them with Redirect 301

Other than that a quick and nasty solution is to disable all other web sites on apache using **a2dissite** here's the man page - <http://manpages.ubuntu.com/manpages/trusty/man8/a2dissite.8.html>

Then simply add all domains as alias' to your 000-default.conf file by adding 

```
ServerAlias myfirstdomain.com myseconddomain.com www.myfirstdomain.com

```

NOTE: ServerAlias must be added after the 

```
</Directory>

```

tag and before the `</Virtualhost>` tag

This means any domain pointing to your server will be answered by your default apache web site residing in /var/www/

Secondly please understand that Apache calls settings from different files. Those security settings you are fiddling with are already in a file called **/etc/apache2/conf-available/security.conf**

In that file is where you must change:
ServerSignature Off
ServerTokens Prod

Messing with the main apache2.conf is not advisable unless you first understand where all those settings that used to be in apache2.conf have been moved to. They are all there just now located in different .conf files.