Viewing 16 posts - 1 through 16 (of 16 total)
  • Author
    Posts
  • #1001536

    Hi, There,
    I just made my website audit with the WebSite Auditor (part of Link Assistant suite), and the tool is warned me that my custom 404 page isn’t set-up properly. Indeed, the page exists, set-up properly through the Enfold admin, and actually does one “job”.
    The question is, how to ensure WebSite Auditor will recognize the page properly, might be some code need to be placed inside my functions.php to do so, as seems the approach Enfold uses for custom 404 pages isn’t visible in full by professional audit SW?

    #1001626

    Hey DimaP,

    What is wrong with it and what do you need to change?

    Best regards,
    Rikard

    #1001735

    Hi, Rikard,
    my goal is to ensure Website Auditors makes as less as possible various suggestions for my website; considering 404 page is set-up correctly, I don’t understand of why it made me point about some problem there. I don’t know of how to pass this check exactly therefore I revert my question to the Team.

    #1001806

    Hi,

    Thanks for the feedback, though it’s difficult for to know what changes are needed for your site to pass that test. What does the audit suggest that you change? Also, why is it important for your site to pass the test? If your 404 page works as it should, wouldn’t that be enough?

    Best regards,
    Rikard

    #1001999

    Hi, Rikard,
    the issue found is just an information message comes out from Web Auditor side, so the tool is suggested that I don’t have the properly set-up page 404. I assumed that there should be some code to be put into functions that exactly states about page 404 presence & one workability, so due to that Web Auditor may recognize the page properly.
    But if not, the 404 page is working as a charm, no issues w/ one at all, except of the only one info-message found.

    #1002007

    Hi,
    We’re not aware of any missing code, seo or redirection issues with 404 pages. I’d recommend to contact the Web Auditor support and to ask them which parameters/algorithms are used to analyse the 404 page. Based on their answer we can then check if we can solve this issue on our end or if it’s just a false positive.

    Best regards,
    Dude

    #1002014

    Hi, Dude,
    this becomes positive, AS I just dig inside my Admin by checking the 404 and actually being set-up correctly, it doesn’t being displaying so it displays the SEO Title only, but no content – this is almost strange, so I will give a temporary admin access to have a look through & help to fix the issue… So Web Auditor had the right opinion …

    #1002485

    Hi,

    I noticed that you have two languages in your installation and one of them doesn’t have any pages on it. Why is that?
    I’m not really sure where to check, unfortunately. What do you mean by “it becomes positive”?

    Best regards,
    Ismael

    #1002517

    Hi, Ismail,
    good to hear you again! As far as you noticed the main website language is RU, but there will be a few other languages on top. As we’re still staying in the DEV phase for the main language, simply we don’t rush ourselves in the other languages.
    “Becomes positive” means that Website Auditor’s audit was the right one – the custom 404 page there doesn’t work at the moment, meaning when I type a bit of abracadabra in the search string like https://domainname.com/jkhjhjhjhjhj the page redirects to (seems to be to the 404 custom page) as I can see the SEO Title of the page on top of the browser, but the page content is simply absent – the totally white page.
    Why is that I don’t know … )

    #1003048

    Hi,

    This seems to be an wpml issue. Please try to add this code to your child theme functions.php:

    
    add_action( 'template_redirect', 'redirect_404_to_any_url' );
    function redirect_404_to_any_url() 
    {
        if(is_404())
        {
        	$error404_page = avia_get_option('error404_page');
        	$url = '';
    
        	if($error404_page) $url = get_permalink($error404_page);
    
        	if($url) wp_redirect($url); 
    
    		exit;
    	}
    }
    

    and check if this solves the issue. If not try this code:

    
    add_action( 'template_redirect', 'redirect_404_to_any_url' );
    function redirect_404_to_any_url() 
    {
        if(is_404())
        {
        	$error404_page = avia_get_option('error404_page');
        	$url = '';
    
        	if($error404_page)
        	{
        		$error404_page = apply_filters('wpml_object_id', $error404_page, 'page', TRUE);
        		$url = get_permalink($error404_page);
        	}
    
        	if($url) wp_redirect($url); 
    
    		exit;
    	}
    }
    

    and check the 404 page again.

    Best regards,
    Dude

    #1003102

    Hi, Dude,
    thanks for your cordial involvement. )

    I’ve been trying to update my functions w/ your both Code 1 & Code 2, at the current set-up of my website, meaning 404 page was translated to RU, having had the RU slug – NO way,
    then I’ve changed that page’ slug in /error/ and tried to apply both Code 1 & Code 2 – NO way,
    finally, I put that RU 404 page in the trash, and changed one for the proper 404 EN page from my other website (this page is now presence @ Admin), then did all the stuff again, NO way…

    All outcomes are similar to each other,- 404 page seems to be loading, as far as you can see one SEO Title on-top, but not displaying the content within…

    Quite a strange situation, but still hope to fix one of somehow …

    #1003112

    Hi,

    Can you create me an ftp account please? I need to debug the code and direct access to the files helps me a lot.

    Best regards,
    Dude

    #1003121

    Sure, … ) SFTP or SSH (should work also)

    #1003136

    Hi,

    I fixed this error with following code now:

    
    
    /* fix 404 pages with wpml redirection */
    add_action( 'template_redirect', 'redirect_404_to_any_url' );
    function redirect_404_to_any_url() 
    {
        if(is_404())
        {
        	$error404_page = avia_get_option('error404_page');
        	$url = '';
    
        	if($error404_page)
        	{
        		$error404_page = apply_filters('wpml_object_id', $error404_page, 'page', TRUE);
        		$url = get_permalink($error404_page);
        	}
    
        	if($url) wp_redirect($url); 
    
    		exit;
    	}
    }
    
    function av_error404_wpml($posts)
    {
    	return $posts;
    }
    
    

    So basically I just added:

    
    function av_error404_wpml($posts)
    {
    	return $posts;
    }
    

    which overwrites our wpml 404 function. Afaik our dev already fixed some incompatibility issues with the latest wpml version and these fixes should be part of the next theme update.

    Best regards,
    Dude

    #1003158

    Wow! Everything works as a charm, Dude, u r the Rock! Thank you!

    #1003205

    Hi,

    Great, glad it works now :)

    Best regards,
    Dude

Viewing 16 posts - 1 through 16 (of 16 total)
  • You must be logged in to reply to this topic.