Project

General

Profile

Possible to rewrite .php URLs?

Added by natethelen over 14 years ago

I have a site that is running PHP and I am rewriting pages like this:

http://mydomain.com/go/http://someothersite/destination

It then logs the click and redirects. This works most of the time. The problem is that if the destination URL ends in .php:

http://mydomain.com/go/http://someothersite/destination.php

I get a 404 because my server cannot find the file at /var/www/html/go/http://someothersite/destination.php

I have a rewrite rule like this:

"^/go/(.*)$" => "/go.php?dest=$1"

But it seems that lighttpd first looks at the fastcgi settings before the rewrite rules. Thoughts?