Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix htaccess code to delete 404 error to 410 gone

Discussion in 'Misc WordPress Requests' started by mjoly2000, Jan 17, 2018.

  1. mjoly2000

    Guest

    htaccess code to delete 404 error to 410 gone, by mjoly2000

    Hi,
    I would like to use the htaccess file to tell Google that several pages have been permanently deleted using error 410. I have this code and would like to know if it will work:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ /errorpage.php [L]

    and I created a php file with these lines:

    <?php header($_SERVER[‘SERVER_PROTOCOL’].’ 410 Gone’);

    Will this tell Google to no longer give me a 404 error but rather a 410 error?

    Thanks a lot,
    Martin

    htaccess code to delete 404 error to 410 gone
     
    #1

Share This Page

Monarch Social Sharing Plugin