Use the following procedure to debug rewrite issues encountered when using Apache.
In order to enable rewrite trace logs, the LogLevel directive must be used.
The most effective context to use the LogLevel directive is the VirtualHost context.
Due to this requirement, you will need to set up a VirtualHost include for the affected domain with the following instructions:
Once the VirtualHost include is set up for the domain add the following directive to the include file for both the std and ssl version of the include:
LogLevel alert rewrite:trace8
tail -fn0 /etc/apache2/logs/error_log | grep '[rewrite:'