I have an issue with redirect originally my URL like this


but when I add string/page/4` in URL is still OK

Like this


I don't know what cause it, I want when to add string/page/4 it's supposed to be 404

tips are base. carrieretips is category

Here my rules

/*custom rules*/

add_action( 'rewrite_rules_array', 'rewrite_rules' ); function rewrite_rules( $rules ) {

$new_rules = array(
    'tips/(.+?)/(?:/([0-9]+))?/?$' => 'category_name=$matches[1]&paged=$matches[2]',
    '(tips)/(.+?)/(page)/(.+?)(?:/([0-9]+))?/?$' =>'category_name=$matches[2]&paged=$matches[4]',

return $new_rules + $rules;


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.