Convert .htaccess for Ligthttpd

Discussion in 'Site & Server Administration' started by mrwicked1981, Apr 8, 2013.

  1. #1
    Hello,

    i have some trouble with ligthttpd. I have try to convert my apache rules to ligthttpd but it was not for all possible.


    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^(.+)\~s$
    RewriteRule ^(.*) stats.php?u=$1 [L]
    RewriteCond %{REQUEST_URI} ^(.+)\~d$
    RewriteRule ^(.*) delete_file.php?u=$1 [QSA,L]
    RewriteCond %{REQUEST_URI} ^(.+)\~i$
    RewriteRule ^(.*) share_file.php?u=$1 [QSA,L]
    RewriteCond %{REQUEST_URI} ^(.+)\~f$
    RewriteRule ^(.*) view_folder.php?f=$1 [QSA,L]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !\.html$
    RewriteRule ^(.*) file_download.php?u=$1 [QSA,L]

    RewriteRule ^(.*).html$ $1.php [L]
    My try was not the best:
    url.rewrite-once = (
    "^/(.*).php$" => "$0",
    "^/(.*).html" => "$1.php",
    # "^/([^\?]+)(\?(.*))?" => "$1.php?$3",
    "^/(.+)\~i"=>"share_file.php?u=$1",
    "^/(.+)\~s"=>"stats.php?u=$1",
    "^/(.+)\~d(?:\?(.*))?"=>"delete_file.php?$2&u=$1",
    "^/(.+)\~f"=>"view_folder.php?u=$1",
    "^/themes.*/(.*)" => "$0",
    "^/js.*/(.*)" => "$0",
    "^/includes.*/(.*)" => "$0",
    "^/admin.*/(.*)" => "$0",
    "^/mysql.*/(.*)" => "$0",
    "^/plugins.*/(.*)" => "$0",
    "^/mrtg/(.*)" => "$0",
    "^/plugins/mediaplayer/asset/jwplayer/jwplayer.html5.js$" => "$0",
    "^/istream/([a-zA-Z0-9_-]+)/(.*)\.(mp4|flv|test)$" => "istream/$1/$2",
    "^/(.+)/([^\?]+)(\?(.*))?"=>"file_download.php?u=$1&$4",
    # "^/(.+)([^\?]+)(\?(.*))?"=>"file_download.php?u=$1&$4",
    # "^/(.+)/$"=>"file_download.php?u=$1",
    "^/(.+)$"=>"file_download.php?u=$1",
    )
    lg
    Rolf
     
    mrwicked1981, Apr 8, 2013 IP
  2. MilesWeb

    MilesWeb Well-Known Member

    Messages:
    869
    Likes Received:
    35
    Best Answers:
    7
    Trophy Points:
    173
    #2
    MilesWeb, Apr 8, 2013 IP
  3. mrwicked1981

    mrwicked1981 Greenhorn

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    13
    #3
    Hi,

    i know the site.. but i dont have find any tool to convert this automatical?

    regards
     
    mrwicked1981, Apr 8, 2013 IP
  4. MilesWeb

    MilesWeb Well-Known Member

    Messages:
    869
    Likes Received:
    35
    Best Answers:
    7
    Trophy Points:
    173
    #4
    I doubt if there is any which will convert it automatically. I am afraid, but you will have to manually convert it.
     
    MilesWeb, Apr 8, 2013 IP
  5. mrwicked1981

    mrwicked1981 Greenhorn

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    13
    #5
    thanks for your help, but i need help for the regex entrys.. so this site have allready know but dont resolv my problem, really
     
    mrwicked1981, Apr 8, 2013 IP