Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #83158
    Lars
    Participant

    Hi
    I would appreciate some assistance on the following (Using Catch Flames Pro):

    Is it possible (and how) to return the 404.php (including the proper html 404 response for search engines) for post-/author-/archive not found instead of the default theme text, similar to “pages not found” ? Url: http://energyfaculty.com (example: energy faculty.com/author and energy faculty.com/author/user)

    I am looking forward to your response.

    #83206
    Mahesh
    Keymaster

    Hi @Lars,

    I am a bit confused on what you’ve mentioned above. Do you mean to change below text for “http://energyfaculty.com/author/user” for your custom text.
    “Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.”
    If so, you have to create a child theme, please visit this LINK for more details on how to create child theme.
    Copy following files from Catch Flames Pro theme to the child theme.
    1. author.php
    2. archive.php

    Below code is for author.php:
    Replace this code
    <?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'catch-flames' ); ?>

    with this
    <?php _e( 'Your Custom Text', 'catch-flames' ); ?>

    Note: Replace “Your Custom Text” with your desired text.

    Make the same change for archive.php too.

    Regards,
    Mahesh

    #83217
    Lars
    Participant

    Hello Mahesh
    Thank you very much for your response.
    I believe that you to a large extent have understood what I was asking for, in particular in respect of custom text. However, my request was kind of two fold:

    1. Changed text for archives/post/user pages not found (since our site do not use/have posts and probably will not ever), which you have responded to.

    2.To return “proper” 404 response when someone (including web crawlers) try to open such, non existing (archive/post/user) pages. The reason for asking is that search engines detect and report “soft 404 errors” connected to such pages.

    I look forward to your comments or proposal for question 2.

    Kind regards
    Lars

    #83219
    Mahesh
    Keymaster

    Hi @Lars,

    I hope I understood your issue. Please clarify me if I still didn’t get you.
    So you mean to display dynamic 404 page errors? Like No post found for blog error or something like that. I’m afraid it cannot be achieved as you desired. Because for the above mentioned issue we need to figure out whether it is a post/page/archive/user. We cannot get the what user/web-crawler is trying to find, which doesn’t exists in the site.

    I hope you understand what I mean.

    Regards,
    Mahesh

    #83220
    Lars
    Participant

    Hi again Mahesh

    Thank you very much for your efforts.

    I am not quite sure if I have been able to fully explain what I am looking for, so i will give it one more try.

    I would like the not found message (similar to 404.php) to be displayed and responded (to users/crawlers) for all items not found on the site (pages, posts, archives,users), independent of which one it is.

    I do hope this clarifies and that you are able to comment/propose solution.

    Kind regards
    Lars

    #83227
    Mahesh
    Keymaster

    Hi @Lars,

    Yes, for all not found items in the site, “Page Not Found” message will be displayed as of 404.php file. I you want the custom message for that then copy 404.php from Catch Flames Pro to child theme. Then modify the message as you desired.

    Let me know if any problems.

    Regards,
    Mahesh

    #83229
    Lars
    Participant

    Hi Mahesh

    Again thank you for your response and your patience with my questions.

    All is fine except when someone try to open http://energyfaculty.com/author/user/ the following text/page is displayed “Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post” (I assume from “archive.php”) and not the 404.php.And this is where search engines detect the “soft 404 error”. Can this be changed?

    Kind regards
    Lars

    #83230
    Mahesh
    Keymaster

    Hi @Lars,

    The text message being displayed is from archive.php instead of 404.php because in your site a user named “user” may exist. But there is no posts by that user. That is why when you visit http://energyfaculty.com/author/user/, the user exists which doesn’t give 404 error but cannot find any post by that user resulting displaying the not found message from archive.php.

    Regards,
    Mahesh

    #83233
    Lars
    Participant

    Hello Mahesh

    That is understood.
    What I actually was trying to find out is if there is any possibility of not only displaying a custom text when this occurs but also to make sure that a “proper” 404 response (for the web crawlers) is made.

    Kind regards
    Lars

    #83298
    Mahesh
    Keymaster

    Hi @Lars,

    This is out of the theme support scope. For this you have to modify the author.php in child theme and put the redirect code if nothing is found i.e. replace the message code with redirect code.

    Regards,
    Mahesh

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Page not found – 404 response’ is closed to new replies.