Mautic Community Forums

How do I use #include (SSI) for pages?

Trying to use a common footer for landing pages, I’ve tested below server side include option successfully from a test html on the site, but it doesn’t work when I create a landing page and view as public page. I’ve changed the top level .htaccess on the domain and it works there, is there a different .htaccess that needs to be updated for landing pages?

Code:

I changed .htaccess as follows:
Code:
AddType text/html .shtml AddHandler server-parsed .shtml Options +Includes

Appreciate any input... I'm trying to avoid making changes to the httpd.conf file, using Apache 2.4

Trying to use a common footer for landing pages, I’ve tested below server side include option successfully from a test html on the site, but it doesn’t work when I create a landing page and view as public page. I’ve changed the top level .htaccess on the domain and it works there, is there a different .htaccess that needs to be updated for landing pages?

   <!--#include virtual="/media/images/footer.shtml" -->

I changed .htaccess as follows:

AddType text/html .shtml AddHandler server-parsed .shtml Options +Includes

Appreciate any input… I’m trying to avoid making changes to the httpd.conf file, using Apache 2.4

I have a solution, but … could I ask someone from tech team to please respond? I added the following to the .htaccess and it works. I’m concerned about performance and other side effects. Could you please let me know if there’s a better way, should I avoid it, or would you bless it?

AddOutputFilter INCLUDES .php

Thanks,

This is the first time I have even heard someone mention using SSI in 10 years. With the fact the Mautic is written in PHP, why wouldnt you just focus on how to add a standard php include to the bottom?

There’s a first time for everything then. One reason is this: “<!–?php” … both froala and ckeditor comments it out. Have you used this feature yourself, if so let me know how you did it. Because you didn’t hear about it in 10 years means what exactly? It’s not a viable solution? If it’s not a viable solution I’d like to know some hard facts, not hearing about it in 10 years doesn’t help much.