Question

I have this incoming link from Facebook,

http://fatstone.tv/portfolio/10-firsts-of-wingsuiting/?fb_action_ids=10152289396001063&fb_action_types=og.likes

but this yields a 404 from Lighttpd.

Desired end-result is: http://fatstone.tv/portfolio/10-firsts-of-wingsuiting/

I've tried

$HTTP["url"] =~ "fb_action_ids" {
        url.redirect = (
                "^/(.*)" => "/$1"
        )
}

and

url.rewrite = (
    "^/(.*)\.(.+)$" => "$0",
    "^/(.+)/?$" => "/$1"
)

to no avail.

Can someone please help me out with the regex!? I don't have any url's that need /? arguments, so a regex to just slice the url starting with the ? would be sufficient, I think.

Was it helpful?

Solution

Try this pattern: ^(.+)\?.*$ (and simply replace with $1)

Note that this will not match URLs that are already formatted the way you want. I'm not sure if that's a problem or something you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top