Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author AITpro

    (@aitpro)

    Yes. Using this example page name: google4ddabfacdb4f6795.html you would do this…

    Negative lookahead if your server supports this regex
    RedirectMatch 410 (?!google4ddabfacdb4f6795)(.*)\.html

    Plugin Author AITpro

    (@aitpro)

    It would probably be better to dumb the code down though. Says Rewrite the google-verification-filename.html file and other-filename.html file and for all other .html files Rewrite/redirect them to a 410 template page.

    RewriteRule ^google-verification-filename\.html$ - [L]
    RewriteRule ^other-filename\.html$ - [L]
    RewriteCond %{REQUEST_URI} ^(.*)\.html [NC]
    RewriteRule ^(.*)$ - [G,NC]

    You can copy this BPS template file: /bulletproof-security/400.php and rename it to 410.php and add the 410 header code directly above <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">:

    <?php
    # BEGIN HEADERS
    header('HTTP/1.1 410 Gone', true, 410);
    header('Status: 410 Gone');
    header('Content-type: text/html; charset=UTF-8');
    header('Cache-Control: no-store, no-cache, must-revalidate' );
    header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
    header('Pragma: no-cache' );
    # END HEADERS
    ?>

    Then add this code to the BPS Root Custom Code text box: CUSTOM CODE ERROR LOGGING AND TRACKING and do all of the Custom Code setup steps. ie save, create a new Master file and activate it.

    ErrorDocument 400 /wp-content/plugins/bulletproof-security/400.php
    ErrorDocument 401 default
    ErrorDocument 403 /wp-content/plugins/bulletproof-security/403.php
    ErrorDocument 404 /404.php
    ErrorDocument 410 /wp-content/plugins/bulletproof-security/410.php

    Plugin Author AITpro

    (@aitpro)

    Actually you do not need to add the header section of code since just using ErrorDocument 410 will generate a 410 header.

    Plugin Author AITpro

    (@aitpro)

    Assuming all questions have been answered – thread has been resolved. If the issue/problem is not resolved or you have additional questions about this specific thread topic then you can post them at any time. We still receive email notifications when threads have been resolved.

    Thread Start Date: 5-24-2015 to 5-25-2015
    Thread Resolved/Current Date: 5-26-2015

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘exclude pages’ is closed to new replies.