[ask]regular expression for .htaccess

Discussion in 'Programming' started by blecock, Sep 23, 2011.

  1. #1
    Hi Folks,

    I need a help here with .htaccess regular expressions.
    Want to forward this www.aloha.com/foo/bar/sample.html to www/aloha/foo/bar/index.php?go=sample
    I tried
    RewriteRule /foo/bar/^(.*)?.html /foo/bar/index.php?go=$1 [L]
    Code (markup):
    but it doesn't work.

    Any suggestion for this?
    Thanks in advance.
     
    blecock, Sep 23, 2011 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    Did you try putting .htaccess file inside "/foo/bar" directory with just

    
    RewriteRule ^(.*)$.html index.php?go=$1 [L]
    
    Code (markup):
    From your rule it seems that "/foo/bar" directory actually exists and may be hence .htaccess is not being applied.
     
    mastermunj, Sep 23, 2011 IP