Tonight I was setting up PHPBay and noticed they don’t seem to have any instructions on their site, or in their documentation or anyone in forums (and, only 3 pages of google results for this.. so I guess nobody else runs LigHTTPD with PHPBay). So, if you happen to be like me, and prefer speed and simplicity to large bloated http servers this may help you out.
I’m not a super ninja with rewrite rules, so I had my buddy Eli Sand from nerdscene give me a hand on these. Also note, depending on your configuration options these might need to be changed. The key thing to note is to convert the (.*) to ([^_]) instead.
Here are the original Apache Rewrite rules;
RewriteRule ^item-(.\*)_(.\*)_(.\*)_(.\*).html$ auction.php?title=$1&item=$2&country=$3&ccid=$4
RewriteRule ^item-(.\*)_(.\*)_(.*).html$ auction.php?title=$1&item=$2&country=$3
RewriteRule ^item-(.\*)_(.\*).html$ auction.php?title=$1&item=$2
Here are the typical redirect rules for your LIGHTTPD WordPress Vhost;
url.rewrite = (
"^/(wp-admin|wp-includes|wp-content)/(.*)" => "$0",
"^/(.*).(.+)$" => "$0",
"^/(.+)/?$" => "/index.php/$1",
)
And, here’s what we’ve added to make it compatible with PHPBay
url.rewrite = (
"^/item-([^_]+)_([^_]+)_([^_]+)_([^_]+).html$" => "/auction.php?title=$1&item=$2&country=$3&ccid=$4",
"^/item-([^_]+)_([^_]+)_([^_]+).html$" => "/auction.php?title=$1&item=$2&country=$3",
"^/item-([^_]+)_([^_]+).html$" => "/auction.php?title=$1&item=$2",**
"^/(wp-admin|wp-includes|wp-content)/(.*)" => "$0",
"^/(.*).(.+)$" => "$0",
"^/(.+)/?$" => "/index.php/$1",
)
Pretty easy stuff really, but took a minute to wrap our heads around the conversion of the rules.
Comments
Comment by Webmaster Chronic on 2009-12-20 12:46:25 -0500
good stuff.