Typically, Mautic is installed in the root domain, but I decided to keep the root domain for my website and install Mautic in a distinct subfolder.
To accomplish this, I adjusted the .htaccess file by prepending “XXX” to the path.
<If “%{REQUEST_URI} =~ m#^/XXX/(index|index_dev|upgrade/upgrade).php#”>
This approach worked effectively, but with each Mautic update, the .htaccess file gets reset. As a result, I need to reapply the changes after every update.
Is there a more effective method for handling this?
If you have similar requirements to mine, here are a couple of solutions I’ve found that worked:
Install Mautic on a Subdomain: This is a clean solution that avoids conflicts and is easier to manage.
Add Custom Directives in the Virtual Host Configuration.
To prevent custom directives from being overridden during Mautic upgrades, add them directly to the Apache virtual host configuration file for your domain.
In my case, my root domain is www.primeogroup.com, and the configuration file is located at:
/etc/httpd/sites-available/www.primeogroup.com.conf