Welcome Guest, Not a member yet? Register   Sign In
Rewrite with lighttpd
#1

Hello.

I am just trying to get my rewrites running with lighttpd but I still get 404 when trying to access sitename.com/page.html

This is my apache rewrite that worked

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|css|images|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

This is my lighttpd config for the vhost for my internal testserver

Code:
# This is a minimal example config
# See /usr/share/doc/lighttpd
# and http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs:ConfigurationOptions

server.port        = 80
server.username        = "http"
server.groupname    = "http"
server.document-root    = "/srv/http"
server.errorlog        = "/var/log/lighttpd/error.log"

server.modules        += ("mod_fastcgi")
fastcgi.server        +=  (".php" => ((
                "bin-path" => "/usr/bin/php-cgi",
                "socket" => "/tmp/php.sock"
                ))
            )

dir-listing.activate    = "disable"
index-file.names    = ( "index.php" )
mimetype.assign        = (
                ".html" => "text/html",
                ".txt" => "text/plain",
                ".jpg" => "image/jpeg",
                ".png" => "image/png",
                ".css" => "text/css",
                #"" => "application/octet-stream"
            )

url.rewrite-once = (
    "/(css|images|js)/" => "$0",
    "^/([^.]+)$" => "/index.php/$1"
)

$HTTP["host"] =~ "hp.test.in" {
    server.document-root = "/srv/http/hp"
    server.errorlog = "/var/log/lighttpd/hp-error.log"
}

I also tried to have the rewrite rule inside $http["host"]...

What am I doing wrong? My lighttpd version is 1.4.35
Reply


Messages In This Thread
Rewrite with lighttpd - by mindphuk - 01-28-2015, 10:36 AM
RE: Rewrite with lighttpd - by Rufnex - 01-28-2015, 10:40 AM
RE: Rewrite with lighttpd - by mindphuk - 01-28-2015, 11:00 AM
RE: Rewrite with lighttpd - by Rufnex - 01-28-2015, 12:27 PM
RE: Rewrite with lighttpd - by CroNiX - 01-28-2015, 12:44 PM
RE: Rewrite with lighttpd - by mindphuk - 01-29-2015, 01:19 AM
RE: Rewrite with lighttpd - by mindphuk - 01-29-2015, 08:45 AM
RE: Rewrite with lighttpd - by Narf - 01-29-2015, 05:30 PM
RE: Rewrite with lighttpd - by mindphuk - 01-30-2015, 07:36 AM
RE: Rewrite with lighttpd - by Rufnex - 01-29-2015, 01:04 PM
RE: Rewrite with lighttpd - by mindphuk - 02-03-2015, 07:24 AM
RE: Rewrite with lighttpd - by mindphuk - 02-04-2015, 03:56 AM
RE: Rewrite with lighttpd - by Rufnex - 02-04-2015, 11:14 AM
RE: Rewrite with lighttpd - by mindphuk - 02-05-2015, 04:49 AM
RE: Rewrite with lighttpd - by Rufnex - 02-05-2015, 05:42 AM
RE: Rewrite with lighttpd - by mindphuk - 02-06-2015, 01:28 AM
RE: Rewrite with lighttpd - by edellascenza - 02-05-2015, 05:24 AM
RE: Rewrite with lighttpd - by mindphuk - 02-06-2015, 01:26 AM
RE: Rewrite with lighttpd - by mwhitney - 02-06-2015, 11:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB