Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 15 of 15
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    mod_rewrite on Lighttpd?

    Hello.
    I have changed from Apache to Lighttpd..
    so how can I use mod_rewrite on LIghttpd?
    or how can I Disable Directory listings on it?

    How can I convert this .htaccess to the Lighttpd?

    anyone can Help?

    Please I need it.

    Code:
    RewriteEngine On
    RewriteRule ^index\.html$ ./index.php?mdrw=on
    RewriteRule ^manual\.html$ ./index.php?action=manual&mdrw=on
    RewriteRule ^([0-9]+)_([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vthread&forum=$1&topic=$2&page=$3&mdrw=on
    RewriteRule ^([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vtopic&forum=$1&page=$2&mdrw=on
    
    Options -Indexes

  • #2
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    To disable directory listings, add this line to your conf file:

    Code:
    dir-listing.activate = "disable"
    The rewrite rules go along the form of, (you'll need to add the remaining ones yourself):

    Code:
    url.rewrite-once = (
        "^index\.html$" => "/index.php?mdrw=on",
        "^manual\.html$" => "/index.php?action=manual&mdrw=on",
    )

  • #3
    Registered User
    Join Date
    Jun 2010
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks..
    but can you tell me in what kind of file I save them?

    lighttpd.conf ?
    I did it but it won't work on my side..

    could you please explain for me how can I create and where can I put that file.
    thanks

  • #4
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Put those in your default lighttpd.conf file which was installed. You need to restart the httpd daemon for the changes to take effect.

  • #5
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,899
    Thanks
    15
    Thanked 226 Times in 226 Posts
    Quote Originally Posted by MattF View Post
    Put those in your default lighttpd.conf file which was installed. You need to restart the httpd daemon for the changes to take effect.
    You may even have to restart your system. In the installation on my machine changes only take effect on a full restart.

  • #6
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Does a kill and restarting it not work? Sounds like one of your rc scripts might be trying a soft restart using that angel thingy that Lighttpd have, or possibly using HUP.

  • #7
    Registered User
    Join Date
    Jun 2010
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by MattF View Post
    To disable directory listings, add this line to your conf file:

    Code:
    dir-listing.activate = "disable"
    The rewrite rules go along the form of, (you'll need to add the remaining ones yourself):

    Code:
    url.rewrite-once = (
        "^index\.html$" => "/index.php?mdrw=on",
        "^manual\.html$" => "/index.php?action=manual&mdrw=on",
    )
    when I put :
    Code:
    dir-listing.activate = "disable"
    and restart lighttpd it works..
    but when I add url.rewrite..
    it won't work at all.. when I restart the site won't open.

    but it just work with disabling url

    so what's the problem?

  • #8
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Quote Originally Posted by Ersa View Post
    so what's the problem?
    Only you can find that out. You may not have the rewrite module installed, there may be a syntax error etc. There is documention on the Lighttpd site:

    http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs

  • #9
    Registered User
    Join Date
    Jun 2010
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Mod_rewrite is active on it.. but it just work with disabling directory listing..

    with mod_rewrite won't work..

    it's the code in apache server .htaccess

    Code:
    RewriteEngine On
    RewriteRule ^index\.html$ ./index.php?mdrw=on
    RewriteRule ^manual\.html$ ./index.php?action=manual&mdrw=on
    RewriteRule ^([0-9]+)_([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vthread&forum=$1&topic=$2&page=$3&mdrw=on
    RewriteRule ^([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vtopic&forum=$1&page=$2&mdrw=on
    Please I need it in my side to get work..
    Thanks

  • #10
    Registered User
    Join Date
    Jun 2010
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    How about NginX server? maybe I change to it?

    what do you think guys?

  • #11
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Personally I think that if you can't be arsed to read documentation and apply the content to your needs, you'll be buggered no matter which HTTPD server you try.

  • #12
    Registered User
    Join Date
    Jun 2010
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mod_rewrite in NginX

    Quote Originally Posted by MattF View Post
    Personally I think that if you can't be arsed to read documentation and apply the content to your needs, you'll be buggered no matter which HTTPD server you try.
    How about if I user nginx what kind of mod_rewrite convert code from .htaccess I user and where exactly I put them?

    how could I convert this to NginX mod_rewrite?
    Code:
    RewriteEngine On
    RewriteRule ^index\.html$ ./index.php?mdrw=on
    RewriteRule ^manual\.html$ ./index.php?action=manual&mdrw=on
    RewriteRule ^([0-9]+)_([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vthread&forum=$1&topic=$2&page=$3&mdrw=on
    RewriteRule ^([0-9]+)_([-0-9]+)\.html$ ./index.php?action=vtopic&forum=$1&page=$2&mdrw=on
    Thanks

  • #13
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts

  • #14
    Registered User
    Join Date
    Jun 2010
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks, but I didn't know how to convert this mod_rewrite for nginx

    and how can we Disable Directory Listing in nginx ?

    if anyone know this two please help me on this.
    thanks

  • #15
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •