• Hi,
    first thank you for that plugin, I find it really useful.

    I have a question/suggestion about the way 404 are handled. If I’m correct, all 404’s are now redirected to the front page, see site.php from line 1320:

    		
    } else { // is_home, is_404
      $link = home_url('/');			
    }
    

    I find it a little problematic as I want to use and send proper 404 headers when it’s the case.
    I’ve changed the code to something like:

    
    } else if(is_404()){ 
      //do not redirect the 404 	
    }else{
      $link = home_url('/');
    }
    

    Do you think it is a change that make sense? and if so, will you consider applying that to the plugin?

    Thanks,
    Giuseppe

Viewing 1 replies (of 1 total)
  • Hello,

    Thank you for your suggestion. Yes that’s right: 404’s are redirected to front page when one try to change the language. It would make sense to redirect to another 404 with the corresponding language instead. So www.example.com/asdfadsfafd would link to www.example.com/it/asdfadsfafd. Is that what you’re suggesting?

    So instead of returning a null link, let’s try to return a translated link, with something like this:

    
    [...]
    } else if(is_404()) { 
      $uri = rtrim($_SERVER['REQUEST_URI'], '/');
      $requested_string = substr($uri, strrpos($uri, '/'));
      $link = home_url(esc_url($requested_string));
    }else{
      $link = home_url('/');
    }
    [...]
    

    How does it sound?

Viewing 1 replies (of 1 total)
  • The topic ‘404 always redirected to front page’ is closed to new replies.