Rewriterule For .htaccess

I have some old urls I would like to rewrite, anyone know the magic words for .htaccess:



– url's like

http://domain.com/aaaa/bbbb/1/

http://domain.com/aaaa/bbbb/14/

http://domain.com/aaaa/bbbb/999/



Rewrite to: http://domain.com/aaaa/bbbb/



–url's like

http://domain.com/cccc/dddd/1/

http://domain.com/cccc/dddd/14/



Rewrite to: http://domain.com/cccc/dddd/





If end of url is “/[1 to 999]/” rewrite to parent directory (one step back)…



/g

read down this page to patterns and replacements…should help.



John

[quote name=‘johnbol1’ timestamp=‘1408279480’ post=‘189754’]

read down this page to patterns and replacements…should help.



John

[/quote]



I have tryed, but I can’t figure it out :-)

Please, try read this topic: Redirect Url In Cs-Cart 4.1.3 - General Questions - CS-Cart Community Forums

Thanks everyone, I do not know if it’s 100% correct but it works as I want :-)



Here is the solution if someone else needs the same.


rewrite domain.tld/a1/a2/a3/0-9*/ => domain.tld/a1/a2/a3 ( to parent no ending ‘/’ )

and let cs4.2x 301 rewrite do the rest…

RewriteRule (.*)/([0-9]+)/$ /$1 [L,R=301]