i currently have wordpress blog with multiple subdomains. Currently the permalink structure is /%year%/%monthnum%/%day%/%postname%/ i want to change it remove year month and day and just put in postname. The problem if i do it now, the existing links will throw a 404 error, to avoid it i want to redirect current permalink structure to new permalink structure
for example i have url http://subdomain1.mydomain.com/2012/07/30/my-post-name/ then i want it to be redirected to http://subdomain1.mydomain.com/my-post-name/
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://subdomain1.mydomain.com/$4
the problem with the above regex is it redirects every subdomain to subdomain1.mydomain.com, i want to something like
RedirectMatch 301 ^subdomain1.domain.com/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://subdomain1.domain.com/$4
RedirectMatch 301 ^subdomain2.domain.com/([0-9]{4})/([0-9]{2})/([0-9]{2})/(.*)$ http://subdomain2.domain.com/$4
the above thing is not working.
can you let me correct regex, i am ready to add a line .htaccess for each subdomain if required