RewriteEngine On

RewriteRule home.html news.php [L]
RewriteRule index.html news.php [L]
RewriteRule index.htm news.php [L]
RewriteRule default.html news.php [L]
RewriteRule default.htm news.php [L]

RewriteBase /

# ===============================================
# NEWS ==========================================
RewriteRule news.html$ news.php [L]
RewriteRule news([0-9]*)-([0-9]*)\.html(.*)$ news.php?$1.$2 [L]
RewriteRule news([0-9]*)-([0-9]*)-([0-9]*)\.html(.*)$ news.php?$1.$2.$3 [L]
RewriteRule news-i([0-9]*)-([0-9]*)\.html(.*)$ news.php?item.$1.$2 [L]
RewriteRule news([0-9]*)\.html(.*)$ news.php?extend.$1 [L]
RewriteRule news-c([0-9]*)\.html(.*)$ news.php?cat.$1 [L]
RewriteRule news-c([0-9]*)-([0-9]*)\.html(.*)$ news.php?cat.$1.$2 [L]

# ==============================================
# DOWNLOADS ====================================
RewriteRule download.html$ download.php [L]
RewriteRule downloads([0-9]*)\.html(.*)$ download.php?view.$1 [L]
RewriteRule download([0-9]*)\.html(.*)$ download.php?list.$1 [L]
RewriteRule downloads([0-9]*)$ download.php?view.$1 [L]
RewriteRule download([0-9]*)$ download.php?list.$1 [L]
RewriteRule request([0-9]*)\.html(.*)$ request.php?$1 [L]

# ==============================================
# PAGE.PHP =====================================
RewriteRule page.html page.php [L]
RewriteRule page([0-9]*)\.html(.*)$ page.php?$1 [L]

#==============================================
# USER.PHP ====================================
RewriteRule user.html user.php [L]
RewriteRule user([0-9]*)\.html(.*)$ user.php?id.$1 [L]

# =============================================
# SUBMITNEWS.PHP ==============================
RewriteRule submitnews.html submitnews.php [L]

# =============================================
# CONTACT.PHP =================================
RewriteRule contact.html contact.php [L]

# =============================================
# COMMENTS ====================================
RewriteRule comment-n([0-9]*)\.html(.*)$ comment.php?comment.news.$1 [L]
RewriteRule reply-n([0-9]*)-([0-9]*)\.html(.*)$ comment.php?reply.news.$1.$2 [L]
RewriteRule reply-d([0-9]*)-([0-9]*)\.html(.*)$ comment.php?reply.download.$1.$2 [L]

# =============================================
# LINKS PAGE PLUGIN ===========================
RewriteRule links.html e107_plugins/links_page/links.php [L]
RewriteRule links([0-9]*)\.html(.*)$ e107_plugins/links_page/links.php?view.$1 [L]
RewriteRule links-([0-9]*)\.html(.*)$ e107_plugins/links_page/links.php?cat.$1 [L]

# =============================================
# CONTENT PLUGIN ==============================
RewriteRule content.html e107_plugins/content/content.php [L]
RewriteRule content([0-9]*)\.html(.*)$ e107_plugins/content/content.php?content.$1 [L]
RewriteRule content-([0-9]*)\.html(.*)$ e107_plugins/content/content.php?recent.$1 [L]

# =============================================
# STATS PLUGIN ================================
RewriteRule stats.html e107_plugins/log/stats.php [L]
RewriteRule stats([0-9]*)\.html(.*)$ e107_plugins/log/stats.php?$1 [L]

# =============================================
# PAGE.PHP ====================================
RewriteRule page/$ page.php [L]
RewriteRule page/([0-9]+)/$ page.php?$1 [L]

# =============================================
# FORUM PLUGIN ================================
RewriteRule forum.html e107_plugins/forum/forum.php [L]
RewriteRule forum([0-9]*)\.html(.*)$ e107_plugins/forum/forum_viewforum.php?$1 [L]
RewriteRule forum([0-9]*)-([0-9]*)\.html(.*)$ e107_plugins/forum/forum_viewforum.php?$1.$2 [L]
RewriteRule forum-t([0-9]*)\.html(.*)$ e107_plugins/forum/forum_viewtopic.php?$1 [L]
RewriteRule forum-t([0-9]*)-([0-9]*)\.html(.*)$ e107_plugins/forum/forum_viewtopic.php?$1.$2 [L]
RewriteRule forum-t([0-9]*)-([0-9]*)-next\.html(.*)$ e107_plugins/forum/forum_viewtopic.php?$1.$2.next [L]
RewriteRule forum-t([0-9]*)-([0-9]*)-prev\.html(.*)$ e107_plugins/forum/forum_viewtopic.php?$1.$2.prev [L]
RewriteRule forum-t([0-9]*)-last\.html(.*)$ e107_plugins/forum/forum_viewtopic.php?$1.last [L]
RewriteRule forum-t([0-9]*)-([0-9]*)-track\.html(.*)$ e107_plugins/forum/forum_viewtopic.php?$1.$2.track [L]
RewriteRule forum-t([0-9]*)-([0-9]*)-untrack\.html(.*)$ e107_plugins/forum/forum_viewtopic.php?$1.$2.untrack [L]
RewriteRule forum-r([0-9]*)\.html(.*)$ e107_plugins/forum/forum_post.php?rp.$1 [L]
RewriteRule forum-p([0-9]*)\.html(.*)$ e107_plugins/forum/forum_post.php?nt.$1 [L]
RewriteRule forum-e([0-9]*)\.html(.*)$ e107_plugins/forum/forum_post.php?edit.$1 [L]
RewriteRule forum-t([0-9]*)-post\.html(.*)$ e107_plugins/forum/forum_viewtopic.php?$1.post [L]
RewriteRule forum-q([0-9]*)\.html(.*)$ e107_plugins/forum/forum_post.php?quote.$1 [L]
RewriteRule top-poster-([0-9]*)-([0-9]*)\.html(.*)$ top.php?$1.top.forum.$2 [L]
RewriteRule top-active([0-9]*)\.html(.*)$ top.php?$1.active [L]
RewriteRule top-active-([0-9]*)-([0-9]*)\.html(.*)$ top.php?$1.active.forum.$2 [L]

# =============================================
# KIG Plugin -- this does not work yet..
RewriteRule gallery.html e107_plugins/kig_menu/index.php [L]
RewriteRule album([0-9]*)\.html(.*)$ e107_plugins/kig_menu/index.php?view=album&albumId=$1 [L]
RewriteRule image([0-9]*)\.html(.*)$ e107_plugins/kig_menu/index.php?view=image&imageId=$1 [L]

# =============================================
# GUESTBOOK PLUGIN ============================
RewriteRule guestbook\.html(.*)$ e107_plugins/guestbook/index.php [L]

# =============================================
# PM PLUGIN ===================================
RewriteRule pm([0-9]*)\.html(.*)$ e107_plugins/pm/pm.php?send.$1 [L]