<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Redirect to the subdomain if accessed from the main domain
RewriteCond %{HTTP_HOST} ^ilmulquran\.com$ [NC]
RewriteCond %{REQUEST_URI} ^/cp [NC]
RewriteRule ^cp(.*)$ http://cp.ilmulquran.com$1 [R=301,L]

# Remove the "index.php" from the URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

# Disable server signature
ServerSignature Off

# Set the default character set
AddDefaultCharset UTF-8

# Prevent directory listing
Options -Indexes
