Skip to content

Instantly share code, notes, and snippets.

@Nyr
Last active December 14, 2015 17:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nyr/5124270 to your computer and use it in GitHub Desktop.
Save Nyr/5124270 to your computer and use it in GitHub Desktop.
lighttpd rewrite rules for archive-my-tweets
# Rewrite for tweets.nyr.be
$HTTP["host"] =~ "(^|\.)tweets.nyr\.be$" {
url.rewrite-once = (
# Single Tweet
"^/([0-9]+)/?$" => "/index.php?id=$1",
# Tweets by date
"^/archive/([0-9]{4})/([0-9]{2})/([0-9]{2})/?$" => "/index.php?year=$1&month=$2&day=$3",
"^/archive/([0-9]{4})/([0-9]{2})/([0-9]{2})/page/([0-9]+)/?$" => "/index.php?year=$1&month=$2&day=$3&page=$4",
"^/archive/([0-9]{4})/([0-9]{2})/?$" => "/index.php?year=$1&month=$2",
"^/archive/([0-9]{4})/([0-9]{2})/page/([0-9]+)/?$" => "/index.php?year=$1&month=$2&page=$3",
"^/archive/([0-9]{4})/?$" => "/index.php?year=$1",
"^/archive/([0-9]{4})/page/([0-9]+)/?$" => "/index.php?year=$1&page=$2",
# Tweets by client
"^/client/(.*)/$" => "/index.php?client=$1",
"^/client/(.*)/page/([0-9]+)/?$" => "/index.php?client=$1&page=$2",
# Paginated Index
"^/page/([0-9]+)/?$" => "/index.php?page=$1",
# Favorites
"^/favorites/?$" => "/index.php?favorites=1",
"^/favorites/page/([0-9]+)/?$" => "/index.php?favorites=1&page=$2",
# Stats
"^/stats/?$" => "/index.php?method=stats",
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment