Help on Restructure URLs (Move Parts of URL) with Mod-Rewrite

I have a multi-language WordPress website where the URL has the following URL structure:

http://www.domain.com/yyyy/mm/dd/abcdefg/xx-yy/

Read More

where xx-yy is the language code.

I intend to make the URL as below:

http://www.domain.com/xx-yy/yyyy/mm/dd/abcdefg/

Where the language code in URL has been moved to the front.

Anybody has any idea what mod-rewrite code which i can used in .htaccess to automatically redirect from the old URL to new URL?

Thanks a lot for any help.

Related posts

Leave a Reply

1 comment

  1. Add this rule to make that work:

    RewriteEngine on
    RewriteRule ([0-9]+)/([0-9]+)/([0-9]+)/(.+)/(.*)/$ /$5/$1/$2/$3/$4/
    

    This will redirect: http://www.domain.com/2011/04/07/abcdefg/xx-yy/ to http://www.domain.com/xx-yy/2011/04/07/abcdefg/