
RewriteOptions inherit
#-----------------------------------
# Delfate
#-----------------------------------

#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript
#BrowserMatch ^Mozilla/4 gzip-only-text/html
#BrowserMatch ^Mozilla/4\.0[678] no-gzip
#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html"

#-- END Delfate

#-----------------------------------
# Although highly unlikely, your host may have +FollowSymLinks enabled at the root level,
# yet disallow its addition in .htaccess; in which case, 
# adding +FollowSymLinks will break your setup (probably a 500 error), 
# so just remove it, and your rules should work fine.
#-----------------------------------

# For security reasons, Option followsymlinks cannot be overridden.
#Options +FollowSymlinks
Options +SymLinksIfOwnerMatch

#-- END +FollowSymLinks

#-----------------------------------
# EE 404 page for missing pages
# Change the path to the correct file location
#-----------------------------------

ErrorDocument 404 /index.php/global/404

#-- END +FollowSymLinks

#-----------------------------------
# Simple 404 for missing files
#-----------------------------------

<FilesMatch "(\.jpe?g|gif|png|bmp|css|js|flv)$">
	ErrorDocument 404 "File Not Found"
</FilesMatch>

#-- END Simple 404 for missing files --

#-----------------------------------
# Block access to "hidden" directories whose names begin with a period. This
# includes directories used by version control systems such as Subversion or Git.
#-----------------------------------

<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule "(^|/)\." - [F]
</IfModule>

#-- Block access to "hidden" directories --

#-----------------------------------
# Remove the www - Uncomment to activate
#-----------------------------------

<IfModule mod_rewrite.c>
    RewriteCond %{HTTPS} !=on
    RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
</IfModule>

# Remove the www - Uncomment to activate

#-----------------------------------
# Remove the trailing slash to paths without an extension
# Uncomment to activate
#-----------------------------------

# <IfModule mod_rewrite.c>
#     RewriteRule ^(.*)/$ /$1 [R=301,L]
# </IfModule>

#-- Remove the trailing slash to paths without an extension --

#-----------------------------------
# Remove index.php from URL
# If you are in a sub directory add the directory path before the /index.php/
#-----------------------------------

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Removes index.php from ExpressionEngine URLs
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

#-- Remove index.php from URL --

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php81” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81___lsphp .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
