• Hello, experts,
    can anyone please guide me how to create a prepend file on Apache with FST CGI?
    On the server I just need to paste the path for this file that will be prepended.

    I have to create a file called headers.php? I’m a bit confused, because on the server, in the place where I have to put the path for this file, is like a predefined path to a file with a diferent name:

    sites/mysite/prepend.inc.php

    So what file should I create?` Whats the content?

    Wordfence is also requesting something like this, but I don’t know if he’s managed to work it out on his own, or if I need to include him in this set as well. And maybe that’s why some of the security headers don’t work even though they are set. thank you very much

Viewing 2 replies - 1 through 2 (of 2 total)
  • ??? What are you trying to accommplish?

    If there is a request from WordFence, please copy and paste the exact statement in a reply.

    No, you don’t load a headers file, you load a preloader file like this:
    php_value auto_prepend_file “/var/www/httpdocs/your-domain.com/preloader.php”

    Peronsally I would run an info() file on my host to check the existing settings, like this:
    https://www.php.net/phpinfo

    Thread Starter realityman

    (@realityman)

    Hi @corrinarusso
    to explain, it will be best, if I copy the instructions from the hosting. I’ll go through option 2. global. This is easy, I know that.
    What I don’t know, is what causes this if it’s not set up and how to create this headers.php (or other) file that contains PHP header() functions or else.

    this is the manual:

    Auto Prepend File
    
    This guide explains how to specify a file that will be loaded before the desired page, including as if it had been called with the 'require()' function.
    
    For example, to modify the headers of a site, you must make a headers.php (or other) file that contains PHP header() functions and prepended to the beginning of each PHP file:
    
        via .user.ini file (specific to a folder)
        or via the site configuration on the Manager (global)
    
    Globally including a file
    
        open the Manager (manager.infomaniak.com)
        go to Hosting
        click on the hosting/domain name concerned
        under Sites at the bottom, click on the domain name of the site concerned
        click on Advanced settings
        under the Apache tab, enter the path of the file to include
        save
    
    The headers defined in a .htaccess file are only valid for non PHP (therefore static) content. 
    
    We use php-fpm, which receives the different headers via apache fast_cgi. In the RFC for cgi_www, the "Strict-Transport-Security" header is not among the headers passed via CGI, as confirmed by the Apache documentation (httpd.apache.org/docs/2.2/howto/cgi.html). Also readhttps://www.ietf.org/rfc/rfc3875
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to prepend file’ is closed to new replies.