##
# phpMyFAQ 2.5 httpd.ini file for one of the url rewriting options
# when running phpMyFAQ on IIS
# Ref.: ISAPI_Rewrite, http://www.isapirewrite.com/
#
# @author    Thorsten Rinne <thorsten@phpmyfaq.de>
# @author    Martin Czura <bae@baerlinonline.de>
# @author    Matteo Scaramuccia <matteo@scaramuccia.com>
# @since     2005-01-05
# @copyright 2005-2011 phpMyFAQ Team
# @version   $Id$
#
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
##

[ISAPI_Rewrite]

# Disable loops while processing the rules
RepeatLimit 0

# the path to your phpMyFAQ installation
UriMatchPrefix    /phpmyfaq/
UriFormatPrefix   /phpmyfaq/

# Block external access to the httpd.ini and httpd.parse.errors files
RewriteRule   httpd(?:\.ini|\.parse\.errors) / [F,I,O]

# Maintenance Section - Uncomment the lines below according to your need
# Write below your client IP address (e.g.: 127.0.0.1)
# if you need to keep your web access during maintenance
#RewriteCond  %REMOTE_ADDR          !^127.0.0.1$
# Return the user an explanation
#RewriteRule   (.*)$                underMaintenance.htm [R]

# index
RewriteRule   index.html$ index.php [I,U,O,L]

# show
RewriteRule   showcat.html$ index.php?action=show [I,U,O,L]

# search
# GET parameter: e.g., search
RewriteRule   search.html\?([^\s]+)$ index.php?$1&action=search [I,U,L]
# No GET parameters at all
RewriteRule   search.html$           index.php?action=search [I,U,O,L]

# addcontent
RewriteRule   addcontent.html$ index.php?action=add [I,U,O,L]

# ask
RewriteRule   ask.html$ index.php?action=ask [I,U,O,L]

# open
RewriteRule   open.html$ index.php?action=open [I,U,O,L]

# help
RewriteRule   help.html$ index.php?action=help [I,U,O,L]

# contact
RewriteRule   contact.html$ index.php?action=contact [I,U,O,L]

# artikel
# GET parameter: e.g., highlight
RewriteRule   ([0-9]+)_([0-9]+)_([a-z\-]+).html\?([^\s]+)$  index.php?$4&action=artikel&cat=$1&id=$2&artlang=$3 [I,U,L]
# No GET parameters at all
RewriteRule   ([0-9]+)_([0-9]+)_([a-z\-]+).html$            index.php?action=artikel&cat=$1&id=$2&artlang=$3 [I,U,O,L]

# category
RewriteRule   category([0-9]+).html$ index.php\?action=show&cat=$1 [I,U,O,L]

# categoryn_n
RewriteRule   category([0-9]+)_([0-9]+).html$  index.php?action=show&cat=$1&seite=$2 [I,U,O,L]

# sitemap
RewriteRule   sitemap-([a-z]+)_([a-z\-]+)\.html$    index.php?action=sitemap&letter=$1&lang=$2 [I,U,O,L]

# solution id
RewriteRule   solution_id_([0-9]+).html$ index.php?solution_id=$1 [I,U,O,L]

# PMF faq record page
# * http://[...]/content/1/1/<LANGUAGE CODE>/<FAQ TOPIC>.htm
# * http://[...]/content/1/1/<LANGUAGE CODE>/<FAQ TOPIC>.html
# GET parameter: e.g., highlight
RewriteRule content/([0-9]+)/([0-9]+)/([a-z\-]+)/(.+)\.htm(l?)\?([^\s]+)$   index.php?$6&action=artikel&cat=$1&id=$2&artlang=$3 [I,U,L]
# No GET parameters at all
RewriteRule content/([0-9]+)/([0-9]+)/([a-z\-]+)/(.+)\.htm(l?)$             index.php?action=artikel&cat=$1&id=$2&artlang=$3 [I,U,O,L]

# PMF category page with page count
# * http://[...]/category/1/<PAGE NUMBER/<CATEGORY NAME>.htm
# * http://[...]/category/1/<PAGE NUMBER/<CATEGORY NAME>.html
RewriteRule category/([0-9]+)/([0-9]+)/(.+)\.htm(l?)$    index.php?action=show&cat=$1&seite=$2 [I,U,O,L]

# PMF category page
# * http://[...]/category/1/<CATEGORY NAME>.htm
# * http://[...]/category/1/<CATEGORY NAME>.html
RewriteRule category/([0-9]+)/(.+)\.htm(l?)$    index.php?action=show&cat=$1 [I,U,O,L]

# PMF news page
# * http://[...]/news/<ID>/<LANGUAGE CODE>/<HEADER>.htm
# * http://[...]/news/<ID>/<LANGUAGE CODE>/<HEADER>.html
RewriteRule news/([0-9]+)/([a-z\-]+)/(.+)\.htm(l?)$     index.php?action=news&newsid=$1&newslang=$2 [I,U,O,L]

# PMF sitemap
# * http://[...]/sitemap/<LETTER>/<LANGUAGE CODE>.htm
# * http://[...]/sitemap/<LETTER>/<LANGUAGE CODE>.html
RewriteRule sitemap/([^\/]+)/([a-z\-]+)\.htm(l?)$   index.php?action=sitemap&letter=$1&lang=$2 [I,U,O,L]

# PMF Google sitemap
# * http://[...]/sitemap.xml
# * http://[...]/sitemap.gz
# * http://[...]/sitemap.xml.gz
RewriteRule sitemap.xml$        sitemap.google.php [L]
RewriteRule sitemap.gz$         sitemap.google.php?gz=1 [L]
RewriteRule sitemap.xml.gz$     sitemap.google.php?gz=1 [L]

# PMF Yahoo sitemap
# * http://[...]/urllist.txt
# * http://[...]/urllist.txt.gz
RewriteRule urllist.txt$        sitemap.yahoo.php [L]
RewriteRule urllist.txt.gz$     sitemap.yahoo.php?gz=1 [L]

# PMF tags page
# * http://[...]/tags/<ID>/<HEADER>.htm
RewriteRule tags/([0-9]+)/([^\/]+)\.htm(l?)$     index.php?action=search&tagging_id=$1 [I,U,O,L]

# instant response
RewriteRule   instantresponse.html$ index.php?action=instantresponse [I,U,O,L]