Could you please help to do a one off redirect in htaccess file from:
/something-something-something-something-c-2_19_70.html
to this type of file that does not have the number -2_:
/something-something-something-something-c-19_70.html
I am sure there is a short code that will get applied to all url of that type
Thank you very much in advance
David
Put this code in your .htaccess under DOCUMENT_ROOT:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# redirect /something-something-something-something-c-2_19_70.html
# to /something-something-something-something-c-19_70.html
RewriteRule ^(.*)2_(.*)$ $1$2 [L,NC,R]
# redirect /ethical-jewellery-silver-c-2_19.html to /silver-c-19.html
RewriteRule ^[^-]+-[^-]+-([^-]+-)([^-]+-)2_(.*)$ $1$2$3 [L,NC,R]
/something-something-something-something-c-2_19_70.html
to /something-something-something-something-c-19_70.html
in my testing. I suggest you to post your complete .htaccess in your question so I can investigate further - anubhava 2012-04-06 19:37
/something-something-something-something-c-2_19_70.html
to /something-something-something-something-c-19_70.html
but your comment is saying a different thing. Anyway pls check my edited answer as per your comment - anubhava 2012-04-08 06:05