There are a few things that may be wrong when upgrading from apache 2.2 to 2.4
Forget to turn on the modules
Sometimes you may forget to enable the used modules on a new server, this is easy to solve by running the apache a2enmod <module> command, you use the rewrite module in you .htaccess, and this can be activated using a2enmod rewrite .
The configuration options you used are renamed
In apache 2.4 there are changes in the names of configuration parameters.
According to the apache update notes, the following things have changed:
AllowOverride now None by default.
See @Gal for more on this change.
PhP cannot be installed / enabled on the new server
Although I doubt that this could be the case, I turned it on, as it could be a problem for other people.
Check if php is installed correctly by creating the phpinfo () file, this file contains <?PHP phpinfo() and should provide the correct php information at startup.
Php can be activated on apache using: a2enmod php5 or a2enmod php7
RewriteRule Log Entry
If the rewrite rules continue to fail, a quick test may include rewriting the rule logs , you can enable them by default using apache "LogLevel" to prevent all of our apache from generating debug messages while still receiving debug messages from the rewrite modules, you you need to prefix the latter using its name. For instance:
LogLevel alert rewrite:trace3
This will enable rewrite level debugging messages for trace3, you can go to lvl trace8 .
The debug messages of the rewrite module can be read as follows:
[rewrite:trace2][rid#7f9c446360a0/initial] init rewrite engine with requested uri / - This means that the rewrite engine is running for the URL
[rewrite:trace3][rid#7f9c446360a0/initial] applying pattern '^.*$' to uri '/' - This means that a RewriteRule working
[rewrite:trace4][rid#7f9c446360a0/initial] RewriteCond: input='/' pattern='^/?projects/old-projects/' => not-matched - This means that a RewriteCond does not match.
[rewrite:trace4][rid#7f9c446360a0/initial] RewriteCond: input='/' pattern='^/?' => matched [rewrite:trace4][rid#7f9c446360a0/initial] RewriteCond: input='/' pattern='^/?' => matched - This means that a RewriteCond matches.
[rewrite:trace2][rid#7f9c446360a0/initial] rewrite '/' -> '/index.html' - RewriteRule redirected you to another page externally
The best way to read debug log files is to use a text editor that does not wrap lines, such as less -R on Linux or Notepad on Windows.