any expert in regexp and .htaccess?

Discussion in 'Apache' started by cmcash, Jan 26, 2009.

  1. #1
    Hi all,

    I am trying to implement a rewrite rule for some pages im my site mut I am having problems defining the right regular expression for it. Maybe some expert people can help me?

    So I want to make this kind of rewriting:

    http://mysite.com/fname.lname -> http://mysite.com/directory/fname.lname

    where fname stands for the first name of a user and lname stands for the last name

    Examples:

    http://mysite.com/john.mark -> http://mysite.com/directory/john.mark
    http://mysite.com/susanne.jones -> http://mysite.com/directory/susanne.jones
    http://mysite.com/louis.gear -> http://mysite.com/directory/louis.gear



    So is there any regexp that I can put in my .htaccess to do it for all these links?
    or the only solution will be to manually introduce one rule for each new user?

    Can someone help me on this?

    Thanks a lot

    Regards.
     
    cmcash, Jan 26, 2009 IP