ISSAE/ - Htaccess File


# These are suggested Rewrite Rules for use with Tiki.
# They enhance security and permit short URLs.
# In your Tiki instance, visit admin.php?page=sefurl
# To use
# 1- rename _htaccess to .htaccess
# or
# 2- add the content of this file to your httpd.conf
# Please find more info here
# This prevents reading of files with certain extensions.
<FilesMatch ".(bak|inc|lib|sh|tpl|sql)$">
  order deny,allow
  deny from all

<FilesMatch ".(js|png|gif|jpg|css)$">
  FileEtag None

# If the site is stable, might be worth setting the expires header on all files
#<IfModule mod_expires.c>
#  <FilesMatch ".(js|png|gif|jpg|css|ico)$">
#    ExpiresActive on
#    ExpiresDefault "access plus 10 years"
#  </FilesMatch>

# Using ETags will lower the YSlow scores
FileETag none

<IfModule deflate_module>
  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript application/javascript

RewriteEngine On

# Apache does not pass Authorization header to CGI scripts
# Rewrite rules for passing authorisation in CGI or FGI mode
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]

# If your Tiki is not at the root of the server (e.g. at 
# You will need to uncomment and fix the RewriteBase value below to suit your installation.
# RewriteBase   "/tiki"
# And if you get errors like "The requested URL /absolutepath/index.php was not found on this server",
# You may need to uncomment the following line.
# RewriteBase   /

#If your website is a checkout
RewriteRule  ^.svn/  -  [F,L]

# If the URL points to a file then do nothing
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule (.*) - [L]

RewriteRule .(css|gif|jpg|png|php|html|js|htm|shtml|cgi|sql|phtml|txt|ihtml)   -       [L]
RewriteRule ^(.+)$                 index.php?page=$1.php              [QSA,L]
# End of rewrite rules

# Error pages, handled by Apache (not by Tiki)
# Tiki can catch some errors and deal with them by redirecting to a similar page, sending you to the search, etc. However, some errors bypass Tiki and must be handled by Apache (ex.: impossiblepagename.php) 
# To use Apache error handling, uncomment the following line and adapt the page name. You must create the page before trying to use it. 
# ErrorDocument 404 /index.php?page=Page+not+found

# to activate the error display, uncomment the following line
#php_flag display_errors on

# increase memory
#php_value memory_limit 128M

# increase execution time (default value in apache use to be 30, and in some cases of long wiki pages with many plugins it may take longer)
#php_value max_execution_time 90

# increase the maximum file size for uploads allowed by php for Tiki (default value in apache use to be 2M which is usually too low for pdf or documents with some images, screenshots, etc)
#php_value upload_max_filesize 10M

# In some cases you may see open_basedir warnings about Smarty accessing php files that it shouldn't
# The following line (uncommented) will reset the include path to use only Tiki's files which will solve this in most cases
#php_value include_path "." 

# if you want to use the Web Server Auth
#AuthType Basic
#AuthName "Restricted Access"
#AuthUserFile /etc/httpd/passwords
#Require valid-user 

<IfModule mod_dir.c>
  DirectoryIndex index.php

On Github License


Download PDF of Htaccess file