RewriteEngine On
RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{REQUEST_URI} !^/admin/
#RewriteCond %{REQUEST_URI} !^/cpanel/
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R,L]

<Files "Sub/Config.inc.php">
    Require all denied
</Files>
<Files "phpcpr.php">
    Require all denied
</Files>
<FilesMatch "^(error\.log)">
    Order deny,allow
    Deny from all
</FilesMatch>

# disable directory browsing
#Options All -Indexes

# prevent folder listing
#IndexIgnore *

#banner impressions
#RewriteRule ^images/banner_imps/([^\/]+)/([^\/]+)/$ /ads/banner-impressions.php?bannerid=$1&c=$2%{QUERY_STRING} 
#banner clicks
RewriteRule ^banner_clicks/([^\/]+)/([^\/]+)$ /ads/campaign-redirect.php?bannerid=$1&c=$2%{QUERY_STRING} 

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .+ - [L]
#RewriteRule ^([A-Za-z0-9_-]+)$ /ads/campaign-redirect.php?c=$1 [QSA,L]
RewriteRule ^([A-Za-z0-9_-]+)$ /campr.php?c=$1 [QSA,L]
#RewriteRule ^share/id/([^/]*)/c/([^/]*)$ /share.php?id=$1&c=$2 [L]

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php_module>
   php_flag display_errors Off
   php_value max_execution_time 300
   php_value max_input_time 600
   php_value max_input_vars 8000
   php_value memory_limit 1000M
   php_value post_max_size 8M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php82" # Update this path
   php_value upload_max_filesize 6M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

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