konzo
konzo

Reputation: 2093

Lighttpd url rewrite with php mvc

I wish to reroute all requests on root/cvideo/... to root/cvideo/index.php, the problem comes on js and css which also get routed, this is the best I can do...

url.rewrite-once = ( "/(js|jpg|css|)/$"=>"$0",
                     "^/cvideo([^?])*$"=>"/cvideo/index.php" )

My regex seems regit but it result in a 404 error whenever I access a js or css file, other parts works fine. Help? Please?

Upvotes: 0

Views: 95

Answers (1)

hjpotter92
hjpotter92

Reputation: 80657

Your regex pattern is a bit wrong:

url.rewrite-once = (
    "^.*\.(js|jpg|css)/?$" => "$0",
    "^/cvideo" => "/cvideo/index.php"
);

Do note that, I'm unaware of how lighttpd handles $0 groups, which is why I've added the .* in pattern.

Upvotes: 1

Related Questions