I've been trying to fix thousands of 404 errors in Google webmaster using htaccess rewrite but not getting anywhere. I read a lot on it but had no luck so far in implementing it successfully.
The errors reported are in this format:
http://sub.example.com/tl/author/admin/page/82
http://sub.example.com/tl/author/admin/page/91
http://sub.example.com/no/author/admin/page/101
These are pages created by a translation plugin which I no longer use. "tl", "no" etc are the language folder.
I want to strip the language folder from the url to make it:
http://sub.example.com/author/admin/page/82
Here is what I entered in htaccess
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^([A-Za-z][A-Za-z])/author/admin/page/([0-9]+)$ http://sub.example.com/author/admin/page/$2 [L,R=301]
</IfModule>
I tried many variations of rewrite rule but nothing worked. Then I removed all regex and simply used the full url:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^http://sub.example.com/tl/author/admin/page/82$ http://sub.example.com/author/admin/page/82 [L,R=301]
</IfModule>
This didn't work either.
Any suggestions.