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 2 months, 1 week ago by Yfchild.
    • This topic was modified 2 months, 1 week ago by Yfchild.
Viewing 9 replies - 1 through 9 (of 9 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 2 months 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.

    Hi

    I have from index google old urls like this

    https://domain.com/seville/url
    https://domain.com/sevilla/url
    https://domain.com/es/seville/url
    https://domain.com/en/seville/url
    https://domain.com/es/sevilla/url
    https://domain.com/en/sevilla/url

    Now, i want redirect them to my new url, all without slug “seville or sevilla”, how i can create a general rules in rank math working or do it with regex and remove “seville or sevilla”¿?

    thanks

    Hello,

    Thank you for contacting Rank Math and sorry for the delayed response.

    Your last reply got stuck in our moderation queue and this is why we could not follow up sooner.

    Back to your question, I can suggest that you head over to Dashboard > Rank Math > Redirections and add a new rule by selecting contains and redirect each one if they are not many.
    If the affected URLs are too many to redirect individually, you can create a regex rule for each of the words that you would like to remove. In the source field, add below code:
    [saville/(.*)]
    and in the destination URL, add this code:
    /$1

    Looking forward to helping you. 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 9 replies - 1 through 9 (of 9 total)

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