Skip to content

Instantly share code, notes, and snippets.

@jqueryalmeida
Forked from MikeNGarrett/wp-config.php
Created February 21, 2020 09:33
Show Gist options
  • Select an option

  • Save jqueryalmeida/e46fb73a59c8101a365d196141741437 to your computer and use it in GitHub Desktop.

Select an option

Save jqueryalmeida/e46fb73a59c8101a365d196141741437 to your computer and use it in GitHub Desktop.

Revisions

  1. @MikeNGarrett MikeNGarrett created this gist Oct 14, 2017.
    11 changes: 11 additions & 0 deletions wp-config.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    <?php
    if(
    strpos( $_SERVER['HTTP_REFERER'], 'wp-admin' ) === false &&
    strpos( $_SERVER['REQUEST_URI'], 'admin-ajax.php' ) !== false
    ) {
    header( 'Cache-Control: max-age=30000, must-revalidate' );
    header( 'Expires: ' . gmdate( 'D, d M Y H:i:s', strtotime( '+5000 minutes' ) ) . ' GMT' );
    header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s', strtotime( '-5000 minutes' ) ) . ' GMT' );
    header( $_SERVER["SERVER_PROTOCOL"]." 404 Not Found" );
    die;
    }