Hi all,
I've been trying to solve an htaccess problem for some time, but no one seems to be able to help fully fix the issue. I cant seem to find a similar issue here in the posts, so here it is in a nutshell:
I need to completely remove a folder from my URL for thousands of pages.The folder that needs to be removed varies slightly. It is either:
/womens-#/ (where # is a 1-3 digit number)
/mens-#/ (where # is a 1-3 digit number)
All Im trying to do is remove the folder, for example:
www.URL.com/folder1/folder2/mens-222/example-product
redirected to:
www.URL.com/folder1/folder2/example-product
One programmer told me to do this all in one rule (instead of creating separate rules for mens and womens. This is what I came up with but something is obviously not working:
RewriteCond %{REQUEST_URI} ^(.*)/mens|womens)-(.*?)/(.*)$
RewriteRule ^(.*)/(mens|womens)-(.*?)/(.*)$ http:
//%{HTTP POST}/$1/$4 [L,R=301]
I know this is close, but it is not working. Can anyone point me in the right direction?
[edited by: jdMorgan at 3:05 am (utc) on May 6, 2010]
[edit reason] de-linked redirect URL [/edit]