Skip to content

Instantly share code, notes, and snippets.

@Nyr
Last active Dec 14, 2015
Embed
What would you like to do?
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