Web Hosting Service Using Apache
If you have Tiki version 1.9.x or greater and are using a web hosting service that uses Apache, then input rewrite rules can be activated as follows:
- Rename the file named _htaccess in your Tiki root directory to .htaccess (or create a symbolic link to .htaccess).
- This will automatically bring in suggested rewrite rules shown below (at Suggested Input Rewrite Rules ) into the .htaccess file. The _htaccess file is included as part of the Tiki download (since version 1.9.3) but is not activated by default because it may not work with all server configurations.
Apache Configuration When Managing Own Server
For better instructions on how to do this see Digital Ocean.
If you manage your server and are using Apache, be sure to
- Load the rewrite module. Something like this line in httpd.conf: LoadModule rewrite_module modules/mod_rewrite.so (adjust the path if necessary). You can check it is ok if you see the mod_rewrite in the apache loaded modules (apachectl -M command).
- Enable the access to .htaccess. To do so you must have lines like:
...
Options FollowSymLinks
AllowOverride FileInfo
...
Adapt the directory path to your need. This block can be in httpd.conf or in your virtual host config (vhosts.d directory in apache2).
The documentation for Apache2 core says that the section requires:
AllowOverride All
- Restart your server
Web Servers Other Than Apache
If you or your web hosting company is using a web server other than Apache (IIS for example), see your server manual or contact your web hosting service to find out how to activate rewrite rules on your server.
Below are the rewrite rules for different versions of Tiki that pull into the .htaccess file automatically when the steps above for Apache web servers are followed.
Rewrite Rules for MultiTiki using Subdirectories as Symlinks[+]
Imagine you have your Tiki set up on a MultiTiki-like installation, and that your Tiki (and the other ones) are created as symlinks. Something like:
- "http://yoursite.com/subdir1/"
- "http://yoursite.com/subdir2/"
- ...
and they all point, as symlinks, to the same tiki installation in your server, let's say:
/var/www/subdir1/ ---> /home/httpd/tiki/
/var/www/subdir2/ ---> /home/httpd/tiki/
...
Your .htaccess under /home/httpd/tiki/ has to be, then, something like the following:
< Click here to view it[-]
# 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]
|