For The Leet Folk. How to Set Up PHPBay with LigHTTPD Rewrites Instead Of Apache.

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.

Popularity: 73% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay

2 Responses to “For The Leet Folk. How to Set Up PHPBay with LigHTTPD Rewrites Instead Of Apache.”

  1. [...] For The Leet Folk. How to Set Up PHPBay with LigHTTPD Rewrites Instead Of Apache. | Flintston.es very nice [...]

Leave a Reply