Options +FollowSymlinks -Indexes

<IfModule mod_security.c>
	# Turn off mod_security filtering.
	SecFilterEngine Off

	# The below probably isn't needed, but better safe than sorry.
	SecFilterScanPOST Off
</IfModule>

# This is the easiest way to get IKM working with Clean URLS
<IfModule mod_mime.c>
	Options +MultiViews
</IfModule>

<IfModule !mod_mime.c>
	RewriteEngine On

	# If IKM is installed in a directory other then the document root
	# I.E www.example.com/ then you may need to uncomment this and set it to
	# the path to your IKM installation
	#RewriteBase /knowledgemanager

	<IfModule !mod_php4.c>

		<IfModule !mod_php5.c>

			# PHP is in CGI Mode, so we need a different mod_rewrite

			RewriteCond %{REQUEST_URI} !categories\.php
			RewriteRule ^categories(.*) categories.php?$1 [L]

			RewriteCond %{REQUEST_URI} !questions\.php
			RewriteRule ^questions(.*)$ questions.php?$1 [L]

			RewriteCond %{REQUEST_URI} !search\.php
			RewriteRule ^search(.*)$ search.php?$1 [L]

		</IfModule>

		<IfModule mod_php5.c>

			# Using PHP 5 in module mode

			RewriteCond %{REQUEST_URI} categories.*
			RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L]

			RewriteCond %{REQUEST_URI} questions.*
			RewriteRule ^questions(.*)$ questions.php?$1 [T=application/x-httpd-php,L]

			RewriteCond %{REQUEST_URI} search.*
			RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L]

		</IfModule>

	</IfModule>

	<IfModule mod_php4.c>

		# PHP 4 in module mode

		RewriteCond %{REQUEST_URI} categories.*
		RewriteRule ^categories(.*)$ categories.php?$1 [T=application/x-httpd-php,L]

		RewriteCond %{REQUEST_URI} questions.*
		RewriteRule ^questions(.*)$ questions.php?$1 [T=application/x-httpd-php,L]

		RewriteCond %{REQUEST_URI} search.*
		RewriteRule ^search(.*)$ search.php?$1 [T=application/x-httpd-php,L]

	</IfModule>
</IfModule>
