I've a lot of url with same estructure/blog/<category>/item/<slug-article> Such/blog/administracion-sistemas-unix/item/named-run-giganteI like create a rule to move a first levelhttps://<site>/<slug-article>https://<site>/named-run-giganteI not found any solution for this without create a rule for every category
Redirect old url with several dirs to first level
htaccess;url rewriting
RedirectMatch 301 /blog/(.*)/item/(.*) /$2You seem to be along the right lines, however, this potentially matches too much (eg. multiple path segments, any characters, no slug at all, etc.). Generally, you should be as specific as possible. For instance, if your category and slug-article consist of only lowercase letters and hyphens then try something like:RedirectMatch 301 ^/blog/[a-z-]+/item/(.+) /$1This includes a start of string anchor (^) so /blog/... must occur only at the start of the URL. Also removed the capturing group from the first subpattern - this is unnecessary since you only appear to need the slug-article.You'll need to clear your browser cache before testing.Note that if you have existing mod_rewrite directives (ie. you are using WordPress or other popular CMS) then you should use mod_rewrite instead, to avoid potential conflicts. For example, at the start of your .htaccess file:RewriteRule ^blog/[a-z-]+/item/(.+) /$1 [R=301,L]