Copy to clipboard
# These are suggested Rewrite Rules for use with Tiki.
# They enhance security and permit short URLS.
#
# To use
# 1- rename _htaccess to .htaccess
# or
# 2- add the content of this file to your httpd.conf
#
# Please find more info here
# http://doc.tiki.org/Rewrite+Rules
#
order deny,allow
deny from all
RewriteEngine On
# rewrite for multitiki sites, when configured as symlinks, not as apache aliases
RewriteCond %{SCRIPT_FILENAME}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]
# direct one-word access for tiki in /subdir1/
RewriteRule ^articles$ /subdir1/tiki-view_articles.php [L]
RewriteRule ^blogs$ /subdir1/tiki-list_blogs.php [L]
RewriteRule ^calendar$ /subdir1/tiki-calendar.php [L]
RewriteRule ^categories$ /subdir1/tiki-browse_categories.php [L]
RewriteRule ^charts$ /subdir1/tiki-list_charts.php [L]
RewriteRule ^chat$ /subdir1/tiki-chat.php [L]
RewriteRule ^contact$ /subdir1/tiki-contact.php [L]
RewriteRule ^directories$ /subdir1/tiki-directory_browse.php [L]
RewriteRule ^eph$ /subdir1/tiki-eph.php [L]
RewriteRule ^faqs$ /subdir1/tiki-list_faqs.php [L]
RewriteRule ^files$ /subdir1/tiki-file_galleries.php [L]
RewriteRule ^forums$ /subdir1/tiki-forums.php [L]
RewriteRule ^images$ /subdir1/tiki-galleries.php [L]
RewriteRule ^irc$ /subdir1/tiki-irc_logs.php [L]
RewriteRule ^galleries$ /subdir1/tiki-galleries.php [L]
RewriteRule ^games$ /subdir1/tiki-list_games.php [L]
RewriteRule ^login$ /subdir1/tiki-login.php [L]
RewriteRule ^mobile$ /subdir1/tiki-mobile.php [L]
RewriteRule ^my$ /subdir1/tiki-my_tiki.php [L]
RewriteRule ^newsletters$ /subdir1/tiki-newsletters.php [L]
RewriteRule ^quizzes$ /subdir1/tiki-list_quizzes.php [L]
RewriteRule ^sheets$ /subdir1/tiki-sheets.php [L]
RewriteRule ^stats$ /subdir1/tiki-stats.php [L]
RewriteRule ^surveys$ /subdir1/tiki-list_surveys.php [L]
RewriteRule ^trackers$ /subdir1/tiki-list_trackers.php [L]
RewriteRule ^wml$ /subdir1/tiki-mobile.php [L]
RewriteRule ^workspaces$ /subdir1/tiki-workspaces_admin.php [L]
# direct one-word access for tiki in /subdir2/
RewriteRule ^articles$ /subdir2/tiki-view_articles.php [L]
RewriteRule ^blogs$ /subdir2/tiki-list_blogs.php [L]
RewriteRule ^calendar$ /subdir2/tiki-calendar.php [L]
RewriteRule ^categories$ /subdir2/tiki-browse_categories.php [L]
RewriteRule ^charts$ /subdir2/tiki-list_charts.php [L]
RewriteRule ^chat$ /subdir2/tiki-chat.php [L]
RewriteRule ^contact$ /subdir2/tiki-contact.php [L]
RewriteRule ^directories$ /subdir2/tiki-directory_browse.php [L]
RewriteRule ^eph$ /subdir2/tiki-eph.php [L]
RewriteRule ^faqs$ /subdir2/tiki-list_faqs.php [L]
RewriteRule ^files$ /subdir2/tiki-file_galleries.php [L]
RewriteRule ^forums$ /subdir2/tiki-forums.php [L]
RewriteRule ^images$ /subdir2/tiki-galleries.php [L]
RewriteRule ^irc$ /subdir2/tiki-irc_logs.php [L]
RewriteRule ^galleries$ /subdir2/tiki-galleries.php [L]
RewriteRule ^games$ /subdir2/tiki-list_games.php [L]
RewriteRule ^login$ /subdir2/tiki-login.php [L]
RewriteRule ^mobile$ /subdir2/tiki-mobile.php [L]
RewriteRule ^my$ /subdir2/tiki-my_tiki.php [L]
RewriteRule ^newsletters$ /subdir2/tiki-newsletters.php [L]
RewriteRule ^quizzes$ /subdir2/tiki-list_quizzes.php [L]
RewriteRule ^sheets$ /subdir2/tiki-sheets.php [L]
RewriteRule ^stats$ /subdir2/tiki-stats.php [L]
RewriteRule ^surveys$ /subdir2/tiki-list_surveys.php [L]
RewriteRule ^trackers$ /subdir2/tiki-list_trackers.php [L]
RewriteRule ^wml$ /subdir2/tiki-mobile.php [L]
RewriteRule ^workspaces$ /subdir2/tiki-workspaces_admin.php [L]
# access any object by its numeric identifier for tiki in /subdir1/
RewriteRule ^article([0-9]+) /subdir1/tiki-read_article.php?articleId=$1 [QSA,L]
RewriteRule ^art([0-9]+) /subdir1/tiki-read_article.php?articleId=$1 [QSA,L]
RewriteRule ^blog([0-9]+) /subdir1/tiki-view_blog.php?blogId=$1 [QSA,L]
RewriteRule ^blogpost([0-9]+) /subdir1/tiki-view_blog_post.php?postId=$1 [QSA,L]
RewriteRule ^cat([0-9]+) /subdir1/tiki-browse_categories.php?parentId=$1 [QSA,L]
RewriteRule ^categ([0-9]+) /subdir1/tiki-browse_categories.php?parentId=$1 [QSA,L]
RewriteRule ^chart([0-9]+) /subdir1/tiki-view_chart.php?chartId=$1 [QSA,L]
RewriteRule ^directory([0-9]+) /subdir1/tiki-directory_browse.php?parent=$1 [QSA,L]
RewriteRule ^dl([0-9]+) /subdir1/tiki-download_file.php?fileId=$1 [QSA,L]
RewriteRule ^eph([0-9]+) /subdir1/tiki-directory_browse.php?parent=$1 [QSA,L]
RewriteRule ^faq([0-9]+) /subdir1/tiki-view_faq.php?faqId=$1 [QSA,L]
RewriteRule ^file([0-9]+) /subdir1/tiki-list_file_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^forum([0-9]+) /subdir1/tiki-view_forum.php?forumId=$1 [QSA,L]
RewriteRule ^img([0-9]+) /subdir1/show_image.php?id=$1 [QSA,L]
RewriteRule ^image([0-9]+) /subdir1/tiki-browse_image.php?imageId=$1 [QSA,L]
RewriteRule ^int([0-9]+) /subdir1/tiki-integrator.php?repID=$1 [QSA,L]
RewriteRule ^irc([0-9]+) /subdir1/tiki-irc_logs.php?focus=$1 [QSA,L]
RewriteRule ^gal([0-9]+) /subdir1/tiki-browse_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^gallery([0-9]+) /subdir1/tiki-browse_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^newsletter([0-9]+) /subdir1/tiki-newsletters.php?nlId=$1 [QSA,L]
RewriteRule ^page([0-9]+) /subdir1/tiki-index_raw.php?page_ref_id=$1 [QSA,L]
RewriteRule ^page-([A-Za-z0-9]+) /subdir1/tiki-index_raw.php?page=$1 [QSA,L]
RewriteRule ^poll([0-9]+) /subdir1/tiki-poll_results.php?pollId=$1 [QSA,L]
RewriteRule ^quiz([0-9]+) /subdir1/tiki-take_quiz.php?quizId=$1 [QSA,L]
RewriteRule ^sheet([0-9]+) /subdir1/tiki-view_sheets.php?sheetId=$1 [QSA,L]
RewriteRule ^survey([0-9]+) /subdir1/tiki-take_survey.php?surveyId=$1 [QSA,L]
RewriteRule ^tracker([0-9]+) /subdir1/tiki-view_tracker.php?trackerId=$1 [QSA,L]
RewriteRule ^vote([0-9]+) /subdir1/tiki-poll_form.php?pollId=$1 [QSA,L]
RewriteRule ^wiki-([A-Za-z0-9]+) /subdir1/tiki-index_raw.php?page=$1 [QSA,L]
RewriteRule ^ws([0-9]+) /subdir1/tiki-workspaces_desktop.php?workspaceId=$1 [QSA,L]
# access any object by its numeric identifier for tiki in /subdir2/
RewriteRule ^article([0-9]+) /subdir2/tiki-read_article.php?articleId=$1 [QSA,L]
RewriteRule ^art([0-9]+) /subdir2/tiki-read_article.php?articleId=$1 [QSA,L]
RewriteRule ^blog([0-9]+) /subdir2/tiki-view_blog.php?blogId=$1 [QSA,L]
RewriteRule ^blogpost([0-9]+) /subdir2/tiki-view_blog_post.php?postId=$1 [QSA,L]
RewriteRule ^chart([0-9]+) /subdir2/tiki-view_chart.php?chartId=$1 [QSA,L]
RewriteRule ^cat([0-9]+) /subdir2/tiki-browse_categories.php?parentId=$1 [QSA,L]
RewriteRule ^categ([0-9]+) /subdir2/tiki-browse_categories.php?parentId=$1 [QSA,L]
RewriteRule ^directory([0-9]+) /subdir2/tiki-directory_browse.php?parent=$1 [QSA,L]
RewriteRule ^dl([0-9]+) /subdir2/tiki-download_file.php?fileId=$1 [QSA,L]
RewriteRule ^eph([0-9]+) /subdir2/tiki-directory_browse.php?parent=$1 [QSA,L]
RewriteRule ^faq([0-9]+) /subdir2/tiki-view_faq.php?faqId=$1 [QSA,L]
RewriteRule ^file([0-9]+) /subdir2/tiki-list_file_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^forum([0-9]+) /subdir2/tiki-view_forum.php?forumId=$1 [QSA,L]
RewriteRule ^img([0-9]+) /subdir2/show_image.php?id=$1 [QSA,L]
RewriteRule ^image([0-9]+) /subdir2/tiki-browse_image.php?imageId=$1 [QSA,L]
RewriteRule ^int([0-9]+) /subdir2/tiki-integrator.php?repID=$1 [QSA,L]
RewriteRule ^irc([0-9]+) /subdir2/tiki-irc_logs.php?focus=$1 [QSA,L]
RewriteRule ^gal([0-9]+) /subdir2/tiki-browse_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^gallery([0-9]+) /subdir2/tiki-browse_gallery.php?galleryId=$1 [QSA,L]
RewriteRule ^newsletter([0-9]+) /subdir2/tiki-newsletters.php?nlId=$1 [QSA,L]
RewriteRule ^page([0-9]+) /subdir2/tiki-index_raw.php?page_ref_id=$1 [QSA,L]
RewriteRule ^page-([A-Za-z0-9]+) /subdir2/tiki-index_raw.php?page=$1 [QSA,L]
RewriteRule ^poll([0-9]+) /subdir2/tiki-poll_results.php?pollId=$1 [QSA,L]
RewriteRule ^quiz([0-9]+) /subdir2/tiki-take_quiz.php?quizId=$1 [QSA,L]
RewriteRule ^sheet([0-9]+) /subdir2/tiki-view_sheets.php?sheetId=$1 [QSA,L]
RewriteRule ^survey([0-9]+) /subdir2/tiki-take_survey.php?surveyId=$1 [QSA,L]
RewriteRule ^tracker([0-9]+) /subdir2/tiki-view_tracker.php?trackerId=$1 [QSA,L]
RewriteRule ^vote([0-9]+) /subdir2/tiki-poll_form.php?pollId=$1 [QSA,L]
RewriteRule ^wiki-([A-Za-z0-9]+) /subdir2/tiki-index_raw.php?page=$1 [QSA,L]
RewriteRule ^ws([0-9]+) /subdir2/tiki-workspaces_desktop.php?workspaceId=$1 [QSA,L]
# todo add support for all characters allowed in a Wiki name for tiki in subdir1
# make sure this is the last rule!
RewriteRule ^show:(~?)([-_\+A-Za-z0-9]+)$ /subdir1/tiki-slideshow.php?page=$1$2 [QSA,L]
RewriteRule ^(~?)([-_\+A-Za-z0-9]+)$ /subdir1/tiki-index_raw.php?page=$1$2 [QSA,L]
# todo add support for all characters allowed in a Wiki name for tiki in subdir2
# make sure this is the last rule!
RewriteRule ^show:(~?)([-_\+A-Za-z0-9]+)$ /subdir2/tiki-slideshow.php?page=$1$2 [QSA,L]
RewriteRule ^(~?)([-_\+A-Za-z0-9]+)$ /subdir2/tiki-index_raw.php?page=$1$2 [QSA,L]
#for multi-byte char support use for tiki in subdir1
RewriteRule ^([^a-z]+)([^\/]+)([^tki-]+)(.*[^.js]+)(~?)(.*)$ /subdir1/tiki-index_raw.php?page=$1$2$3$4$5$6$7$8$9 [QSA,L]
#for multi-byte char support use for tiki in subdir2
RewriteRule ^([^a-z]+)([^\/]+)([^tki-]+)(.*[^.js]+)(~?)(.*)$ /subdir2/tiki-index_raw.php?page=$1$2$3$4$5$6$7$8$9 [QSA,L]