PHP code example of treblle / security-headers

1. Go to this page and download the library: Download treblle/security-headers library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

treblle / security-headers example snippets


return [
    'remove' => [
        'X-Powered-By',
        'x-powered-by',
        'Server',
        'server',
    ],

    'referrer-policy' => 'no-referrer-when-downgrade',

    'strict-transport-security' => 'max-age=31536000; i=(), payment=(), sync-xhr=(self), usb=()',

    'content-type-options' => 'nosniff',
];
bash
php artisan vendor:publish --provider="Treblle\SecurityHeaders\Providers\PackageServiceProvider" --tag="security-headers"