Get in touch with our team

08.12.2015

1 min read

Making Mautic and WordPress Total Cache play nice together

This article was updated on: 07.02.2022

Mautic is an awesome open source marketing automation tool that the team at Impression have been playing with over the last few weeks. It’s like many of the premium pieces of marketing software out there, except it costs almost nothing — just the cost of a web server and some technical know-how.

The only slight problem with Open Source software is that you don’t always find the answer to an issue you’re looking for online, so you have to diagnose an implementation issue on your own.

So, in the interest of keeping this blog post short and actionable, here’s our situation.

  • WordPress website installed at example.com
  • Mautic installed in a sub folder example.com/mautic/
  • WordPress Total Cache installed on WordPress
  • WP Mautic plugin installed

So, what might the issue be?

Well, in my case, mtracking.gif was hitting a 404 error.

Mautic’s mtracking.gif 404 error explained

The problem lies in this particular installation scenario. Without further instructions, WordPress Total Cache’s default .htaccess configuration can interrupt the proper functionality behind the routing of mtracking.gif to the trackingImage controller.

The fix is simple – just edit your .htaccess file to ignore your Mautic directory, by adding the line RewriteRule ^(mautic)($|/) - [L] like so.


# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteRule ^(mautic)($|/) - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

Don’t forget to change (mautic) to the name of your installation directory.

If this has been helpful, please let us know in the comments below!