Happy Halloween! Get 20% off GP Premium with the discount code: HALLOWEEN20

[Resolved] Custom 410 Error Page

Home Forums Support Custom 410 Error Page

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #865976
    Vish

    So, I am deleting a bunch of URLs and want to mark them with 410 response code.

    I see a similar topic here: https://generatepress.com/forums/topic/custom-410-error-page/

    As suggested in the above topic, I have made a copy of the 404.php and have created 410.php. But it is very basic. I’m not very familiar with PHP codes.

    Previously, I used a plugin to set a page (URL included) I created as 404 page. So, Whenever there is a 404 error, instead of simple page, the page I created is shown.

    The basic 410 page is working fine now. But I was wondering if there is a way to set a custom page (the one in the URL included) as 410 page (preferably without a plugin)?

    GeneratePress 2.2.2
    GP Premium 1.7.8
    #866308
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    This might be something you need to ask your host. They might need to set up your server to redirect 410 errors to your custom page.

    #866500
    Vish

    Thanks for the quick reply, Tom. Didn’t need to ask the hosting provider!

    The solution was quite simple:
    1. Copied the 404.php to 410.php.
    2. Created a normal page in wordpress the way I wanted.
    3. Took the HTML code from the above page and converted it into PHP code via this free tool.
    4. Copy pasted the converted PHP code into the 410.php.
    5. Profit!

    Hope this helps someone!

    #866614
    Tom
    Lead Developer
    Lead Developer
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.