.htaccess => lighttpd config

Discussion in 'Apache' started by col, Nov 29, 2006.

  1. #1
    I'm in need of "translating" the following .htaccess file to code for lighttpd.conf.

    .httpd
    
    Options +Indexes
    RewriteEngine on
    RewriteRule ^go-(.*)-(.*).html$ index.php?go=$1&id=$2 [L,NC]
    RewriteRule ^(.*)-(.*)-(.*).html$ index.php?go=$2&id=$3 [L,NC]
    RewriteRule ^([0-9]+)/[^/]+/([0-9]+)/$ index.php?go=subcat&id=$1&pageNum_pages=$2 [L,NC]
    RewriteRule ^([0-9]+)/.*$ index.php?go=subcat&id=$1 [L,NC]
    
    Code (markup):
    I've been trying the following code in lighttpd.conf for the domain, but it's not working:
    
    url.rewrite = ( "^go-(.*)-(,*).html$" => "index.php?go=$1&id=$2",
                        "^(.*)-(.*)-(.*).html$" => "index.php?go=$2&id=$3",
                        "^([0-9]+)/[^/]+/([0-9]+)/$" => "index.php?go=subcat&id=$1&pageNum_pages=$2",
                        "^([0-9]+)/.*$" => "index.php?go=subcat&id=$1")
    
    
    Code (markup):
    Any suggestions?
     
    col, Nov 29, 2006 IP
  2. col

    col Peon

    Messages:
    618
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Nobody got a clue?
     
    col, Nov 30, 2006 IP
  3. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    can't you just create a .htaccess on the directory level itself?
     
    tanfwc, Nov 30, 2006 IP
  4. col

    col Peon

    Messages:
    618
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #4
    As far as I know Lighttpd doesn't have support for .htaccess files. You have to make the settings directly in the server's config file.
     
    col, Nov 30, 2006 IP
  5. col

    col Peon

    Messages:
    618
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I'll just follow up with the solution if anyone would have the same issue
    
            url.rewrite = ( "^/go-(.*)-(,*).html$" => "index.php?go=$1&id=$2",
                            "^/(.*)-(.*)-(.*).html$" => "index.php?go=$2&id=$3",
                            "^/([0-9]+)/[^/]+/([0-9]+)/$" => "index.php?go=subcat&id=$1&pageNum_pages=$2",
                            "^/([0-9]+)/.*$" => "index.php?go=subcat&id=$1" )
    
    Code (markup):
     
    col, Jan 5, 2007 IP