# Disable directory browsing
Options -Indexes

<IfModule mod_rewrite.c>
	Options +FollowSymlinks
	RewriteEngine On

	# Do not rewrite files already inside public/
	RewriteRule ^public/ - [L]

	# Serve existing files from the project root as-is
	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^ - [L]

	# Map every other request into the CodeIgniter public/ folder
	RewriteRule ^(.*)$ public/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
	ErrorDocument 404 public/index.php
</IfModule>

ServerSignature Off
