Permanent redirect "http://foo/index.php/2007/blog-post" to "...foo/2007/blog-post"

Discussion in 'Apache' started by markowe, Mar 19, 2007.

  1. #1
    I am so stupid...!

    I am not very clued up about regular expressions!

    Because my former provider did not allow .htaccess modification I was using "semi-pretty" permalinks (in Wordpress) like:

    http://my.domain/foo/index.php/2007/blog-post

    which were the best I could do.

    But now I can modify .htaccess, I have got the new permalinks working:

    http://my.domain/foo/2007/blog-post/ (i.e. exactly the same, but without the cheesy /index.php/).

    So how do I add a permanent redirect to the .htaccess file that WP produces, like so:
    ...in order to eliminate that horrible index.php, and redirect crawlers to the new REAL permalink (and eliminate duplicate content).

    I bet it's really simple, but not for me! Many thanks in advance (remember, you were thick once too :) )
     
    markowe, Mar 19, 2007 IP