Redirect "delete" slug but url show 404 found

  • Hi,

    Continue my little stories redirections problems.

    I m working a new site. And now as i have experience with Rank Math, i try to quit slug before continue with the site to have clean urls.

    Any url : https://mydomain.com/listing_cat/my-short-slug/

    to tipical clean slug : https://mydomain.com/my-short-slug/

    I remove listing_cat with your tips regex and Rank math do it but every any page now give me 404

    Can be conflict rules between rank math and wordpress htaccess¿?

    if Rank rewrite like this

    <IfModule mod_rewrite.c>
    # RewriteRule listingcat/(.* https://mydomain.com/$1 [R=301,L]
    </IfModule>

    >>>> can be conflict with default rules wordpress htaccess¿?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    it´s so difficult understand what can be happen.

    • This topic was modified 3 weeks, 3 days ago by Yfchild.
    • This topic was modified 3 weeks, 3 days ago by Yfchild.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hello,

    Thank you for contacting Rank Math today.

    I have been able to reproduce this issue on my end and this has been submitted to our dev team for closer investigation.

    Looking forward to helping you. Thank you.

    ​​​​​​

    Ok. I have the same problem in another site. I´m waiting solution/answer to see if i can replicate in the another site.

    Hello,

    Don’t you want to redirect all the URLs starting with listing_cat/ to the one without having listing_cat in it?

    Looking forward to helping you. Thank you.

    Yes want remove in all urls the slug ” listing_cat”, it´s not working in category

    domain.com/listing_cat/cat1 to domain.com/cat1 not working
    domain.com/listing_cat/itemx to domain.com/itemx working

    Hello,

    If you want to prevent certain URLs from redirecting then that’s not possible. The regex rule will redirect all the URLs starting with listing_cat. There is no way to check if the current redirecting URL belongs to a category or a post.

    Sorry to disappoint you. If there is anything else, please let us know.

    Thank you.

    Pratik

    but why i have 404 for categories if redirection is correct¿?

    • This reply was modified 3 weeks ago by Yfchild.

    Hello,

    but why i have 404 for categories if redirection is correct¿?

    It’s because of the reason I mentioned in my previous reply. The regex redirection rule will redirect all the URL which starts with listing_cat.

    On your site, category URL is domain.com/listing_cat/cat1. Since the URL has listing_cat, it will get redirected to the domain.com/cat1 which is an invalid URL. There is no way to prevent certain URLs from Redirecting.

    If you want category URL without listing_cat then you’ll have to create a new rewrite rule. For that, you can refer the code given in the below documentation: https://rudrastyh.com/wordpress/remove-taxonomy-slug-from-urls.html

    Rank Math’s Redirection module just redirects certain links matching the criteria to the destination URL. It doesn’t create new URLs.

    I hope that clears the confusion. Thank you.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The ticket ‘Redirect "delete" slug but url show 404 found’ is closed to new replies.