RewriteEngine On
# A wiki page whose history or source has been refused enough lately to
# be hot has a marker file, named group-page-arg, in the hot folder under
# Yioop's work directory, written by HotTargets. A request for such a
# page from a reader with no session is refused here, before PHP starts.
# The work directory is looked for at work_directory beside this file,
# where Yioop puts it unless told otherwise. If yours is elsewhere, give
# the web server its hot folder by uncommenting the next line and setting
# the path; Yioop never writes into this source directory, so it cannot
# tell the web server itself.
# SetEnvIf Request_URI . YIOOP_HOT_DIR=/path/to/your/work_directory/hot
RewriteCond %{HTTP_COOKIE} !yioopbiscuit
RewriteCond %{QUERY_STRING} (?:^|&)arg=(history|source)(?:&|$)
RewriteCond %{QUERY_STRING}::%1 (?:^|&)page_id=([0-9]+).*::(.+)
RewriteCond %{REQUEST_URI}::%1-%2 ^.*/group/([0-9]+)(?:/[^/?]*)?::(.+)$
RewriteCond %{CONTEXT_DOCUMENT_ROOT}/work_directory/hot/%1-%2 -f [OR]
RewriteCond %{ENV:YIOOP_HOT_DIR}/%1-%2 -f
RewriteRule ^ - [F,L]
RewriteCond %{HTTP_COOKIE} !yioopbiscuit
RewriteCond %{QUERY_STRING} (?:^|&)arg=(history|source)(?:&|$)
RewriteCond %{QUERY_STRING} !(?:^|&)page_id=
RewriteCond %{REQUEST_URI}::%1 ^.*/group/([0-9]+)/([^/?]+)::(.+)$
RewriteCond %{CONTEXT_DOCUMENT_ROOT}/work_directory/hot/%1-%2-%3 -f [OR]
RewriteCond %{ENV:YIOOP_HOT_DIR}/%1-%2-%3 -f
RewriteRule ^ - [F,L]
RewriteCond %{REQUEST_FILENAME} !index.php
RewriteRule ^ index.php [L]
SetEnv YIOOP_REDIRECTS_ON true