<IfModule mod_rewrite.c>
# PHP Value #
php_value session.auto_start 1
RewriteEngine on

# FORCE HTTPS #
RewriteCond %{HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]

# Menghilangkan Ekstensi [PHP HTML] #
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html

# Pretty URI Desktop
# USER
RewriteRule ^web/?$ platform/desktop/index.php [NC,L]
RewriteRule ^web/login/?$ platform/desktop/views/auth/login.php [NC,L]
RewriteRule ^web/logout/?$ platform/desktop/views/auth/logout.php [NC,L]
RewriteRule ^web/register/?$ platform/desktop/views/auth/register.php [NC,L]
RewriteRule ^web/forgot-passcode/?$ platform/desktop/views/auth/forgot-passcode.php [NC,L]
RewriteRule ^web/dashboard/?$ admin [NC,L]
RewriteRule ^web/profile/?$ platform/desktop/views/pages/profile/index.php [NC,L]

#ADMIN
RewriteRule ^web/admin?$ platform/desktop/views/admin/index.php [NC,L]

# Custom URL #
RewriteCond $1 !^(order/game-detail\.php)
RewriteRule ^order/game/([^/\.]+)/?$ order/game-detail.php?s=$1 [L]
RewriteCond $1 !^(order/voucher-detail\.php)
RewriteRule ^order/vouchers/([^/\.]+)/?$ order/voucher-detail.php?s=$1 [L]
RewriteCond $1 !^(order/e-money-detail\.php)
RewriteRule ^order/emoney/([^/\.]+)/?$ order/e-money-detail.php?s=$1 [L]
RewriteCond $1 !^(order/pasca-bayar-detail\.php)
RewriteRule ^order/pascabayars/([^/\.]+)/?$ order/pasca-bayar-detail.php?s=$1 [L]
RewriteCond $1 !^(order/confirm-prepaid\.php)
RewriteRule ^confirm-prepaid/([^/\.]+)/([^/\.]+)/?$ order/confirm-prepaid.php?code=$1&data=$2 [L]
RewriteCond $1 !^(order/confirm-postpaid\.php)
RewriteRule ^confirm-postpaid/([^/\.]+)/([^/\.]+)/?$ order/confirm-postpaid.php?code=$1&data=$2 [L]
RewriteCond $1 !^(order/confirm-manual\.php)
RewriteRule ^confirm-manual/([^/\.]+)/([^/\.]+)/?$ order/confirm-manual.php?code=$1&data=$2 [L]
RewriteCond $1 !^(order/rincian\.php)
RewriteRule ^order/detail/([^/\.]+)/?$ order/rincian.php?code=$1 [L]
RewriteCond $1 !^(deposit/rincian\.php)
RewriteRule ^deposit/invoice/([^/\.]+)/?$ deposit/rincian.php?code=$1 [L]
RewriteCond $1 !^(deposit/rincian\.php)
RewriteRule ^deposit/invoice deposit/rincian.php [L]
RewriteCond $1 !^(page/info-detail\.php)
RewriteRule ^page/news-detail/([^/\.]+)/?$ page/info-detail.php?shenn=$1 [L]
RewriteCond $1 !^(page/info-detail\.php)
RewriteRule ^page/news-detail page/info-detail.php [L]
RewriteCond $1 !^(deposit/konfirmasi-deposit\.php)
RewriteRule ^konfirmasi-deposit/([^/\.]+)/([^/\.]+)/?$ deposit/konfirmasi-deposit.php?code=$1&data=$2 [L]
RewriteCond $1 !^(shop/detail-produk\.php)
RewriteRule ^shop/detail/([^/\.]+)/?$ shop/detail-produk.php?rgs=$1 [L]
RewriteCond $1 !^(shop/konfirmasi-transaksi\.php)
RewriteRule ^shop/konfirmasi/([^/\.]+)/?$ shop/konfirmasi-transaksi?rgs=$1 [L]
RewriteCond $1 !^(order/pulsa-international-detail\.php)
RewriteRule ^order/pulsa-internationals/([^/\.]+)/?$ order/pulsa-international-detail.php?s=$1 [L]
RewriteCond $1 !^(donasi/donasi-detail\.php)
RewriteRule ^donasi/detail/([^/\.]+)/?$ donasi/donasi-detail.php?s=$1 [L]
RewriteCond $1 !^(bills/bills-detail\.php)
RewriteRule ^bills/detail/([^/\.]+)/?$ bills/bills-detail.php?s=$1 [L]
RewriteCond $1 !^(donasi/confirm-donasi\.php)
RewriteRule ^confirm-donasi/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ donasi/confirm-donasi.php?code=$1&data=$2&data2=$3 [L]
RewriteCond $1 !^(deposit/konfirmasi-donasi\.php)
RewriteRule ^konfirmasi-donasi/([^/\.]+)/([^/\.]+)/?$ deposit/konfirmasi-donasi.php?code=$1&data=$2 [L]

###################################################################################################################################################

RewriteCond %{REQUEST_URI} !(7g_log.php) [NC]    
RewriteCond %{QUERY_STRING} ([a-z0-9]{2000,}) [NC,OR]
RewriteCond %{QUERY_STRING} (/|%2f)(:|%3a)(/|%2f) [NC,OR]
RewriteCond %{QUERY_STRING} (/|%2f)(\|%2a)(\|%2a)(/|%2f) [NC,OR]
RewriteCond %{QUERY_STRING} (~|`|<|>|\^|\|\\|0x00|%00|%0d%0a) [NC,OR]
RewriteCond %{QUERY_STRING} (cmd|command)(=|%3d)(chdir|mkdir)(.*)(x20) [NC,OR]
RewriteCond %{QUERY_STRING} (fck|ckfinder|fullclick|ckfinder|fckeditor) [NC,OR]
RewriteCond %{QUERY_STRING} (thumbs?(_editor|open)?|tim(thumbs?)?)((\.|%2e)php) [NC,OR]
RewriteCond %{QUERY_STRING} (absolute_|base|root_)(dir|path)(=|%3d)(ftp|https?) [NC,OR]
RewriteCond %{QUERY_STRING} (localhost|loopback|127(\.|%2e)0(\.|%2e)0(\.|%2e)1) [NC,OR]
RewriteCond %{QUERY_STRING} (\.|20)(get|the)(_|%5f)(permalink|posts_page_url)(\(|%28) [NC,OR]
RewriteCond %{QUERY_STRING} (s)?(ftp|http|inurl|php)(s)?(:(/|%2f|%u2215)(/|%2f|%u2215)) [NC,OR]
RewriteCond %{QUERY_STRING} (/|%2f)((wp-)?(config)(uration)?)((\.|%2e)inc)?((\.|%2e)php) [NC,OR]
RewriteCond %{QUERY_STRING} (globals|mosconfig([a-z_]{1,22})|request)(=|[|%[a-z0-9]{0,2}) [NC,OR]
RewriteCond %{QUERY_STRING} ((boot|win)((\.|%2e)ini)|etc(/|%2f)passwd|self(/|%2f)environ) [NC,OR]
RewriteCond %{QUERY_STRING} (((/|%2f){3,3})|((\.|%2e){3,3})|((\.|%2e){2,2})(/|%2f|%u2215)) [NC,OR]
RewriteCond %{QUERY_STRING} (benchmark|char|exec|fopen|function|html)(.)(\(|%28)(.)(\)|%29) [NC,OR]
RewriteCond %{QUERY_STRING} (php)([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}) [NC,OR]
RewriteCond %{QUERY_STRING} (e|%65|%45)(v|%76|%56)(a|%61|%31)(l|%6c|%4c)(.)(\(|%28)(.)(\)|%29) [NC,OR]
RewriteCond %{QUERY_STRING} (/|%2f)(=|%3d|$&|_mm|cgi(\.|-)|inurl(:|%3a)(/|%2f)|(mod|path)(=|%3d)(\.|%2e)) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3c)(.)(e|%65|%45)(m|%6d|%4d)(b|%62|%42)(e|%65|%45)(d|%64|%44)(.)(>|%3e) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3c)(.)(i|%69|%49)(f|%66|%46)(r|%72|%52)(a|%61|%41)(m|%6d|%4d)(e|%65|%45)(.)(>|%3e) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3c)(.)(o|%4f|%6f)(b|%62|%42)(j|%4a|%6a)(e|%65|%45)(c|%63|%43)(t|%74|%54)(.)(>|%3e) [NC,OR]
RewriteCond %{QUERY_STRING} (<|%3c)(.)(s|%73|%53)(c|%63|%43)(r|%72|%52)(i|%69|%49)(p|%70|%50)(t|%74|%54)(.)(>|%3e) [NC,OR]
RewriteCond %{QUERY_STRING} (\+|%2b|%20)(d|%64|%44)(e|%65|%45)(l|%6c|%4c)(e|%65|%45)(t|%74|%54)(e|%65|%45)(\+|%2b|%20) [NC,OR]
RewriteCond %{QUERY_STRING} (\+|%2b|%20)(i|%69|%49)(n|%6e|%4e)(s|%73|%53)(e|%65|%45)(r|%72|%52)(t|%74|%54)(\+|%2b|%20) [NC,OR]
RewriteCond %{QUERY_STRING} (\+|%2b|%20)(s|%73|%53)(e|%65|%45)(l|%6c|%4c)(e|%65|%45)(c|%63|%43)(t|%74|%54)(\+|%2b|%20) [NC,OR]
RewriteCond %{QUERY_STRING} (\+|%2b|%20)(u|%75|%55)(p|%70|%50)(d|%64|%44)(a|%61|%41)(t|%74|%54)(e|%65|%45)(\+|%2b|%20) [NC,OR]
RewriteCond %{QUERY_STRING} (\\x00|(\"|%22|\'|%27)?0(\"|%22|\'|%27)?(=|%3d)(\"|%22|\'|%27)?0|cast(\(|%28)0x|or%201(=|%3d)1) [NC,OR]
RewriteCond %{QUERY_STRING} (g|%67|%47)(l|%6c|%4c)(o|%6f|%4f)(b|%62|%42)(a|%61|%41)(l|%6c|%4c)(s|%73|%53)(=|[|%[0-9A-Z]{0,2}) [NC,OR]
RewriteCond %{QUERY_STRING} (_|%5f)(r|%72|%52)(e|%65|%45)(q|%71|%51)(u|%75|%55)(e|%65|%45)(s|%73|%53)(t|%74|%54)(=|[|%[0-9A-Z]{0,2}) [NC,OR]
RewriteCond %{QUERY_STRING} (j|%6a|%4a)(a|%61|%41)(v|%76|%56)(a|%61|%31)(s|%73|%53)(c|%63|%43)(r|%72|%52)(i|%69|%49)(p|%70|%50)(t|%74|%54)(:|%3a)(.*)(;|%3b) [NC,OR]
RewriteCond %{QUERY_STRING} (b|%62|%42)(a|%61|%41)(s|%73|%53)(e|%65|%45)(6|%36)(4|%34)(_|%5f)(e|%65|%45|d|%64|%44)(e|%65|%45|n|%6e|%4e)(c|%63|%43)(o|%6f|%4f)(d|%64|%44)(e|%65|%45)(.)(\()(.)(\)) [NC,OR]
RewriteCond %{QUERY_STRING} (allow_url_(fopen|include)|auto_prepend_file|blexbot|browsersploit|(c99|php)shell|curltest|disable_functions?|document_root|elastix|encodeuricom|exec|exploit|fclose|fgets|fputs|fread|fsbuff|fsockopen|gethostbyname|grablogin|hmei7|input_file|load_file|null|open_basedir|outfile|passthru|popen|proc_open|quickbrute|remoteview|revslider|root_path|safe_mode|shell_exec|site((.){0,2})copier|sux0r|system|trojan|wget|xertive) [NC,OR]
RewriteCond %{QUERY_STRING} (;|<|>|\'|\"|\)|%0a|%0d|%22|%27|%3c|%3e|%00)(.)(/\|alter|base64|benchmark|cast|char|concat|convert|create|encode|declare|delete|drop|insert|md5|order|request|script|select|set|union|update) [NC,OR]
RewriteCond %{QUERY_STRING} ((\+|%2b)(concat|delete|get|select|union)(\+|%2b)) [NC,OR]
RewriteCond %{QUERY_STRING} (union)(.)(select)(.)(\(|%28) [NC,OR]
RewriteCond %{QUERY_STRING} (concat)(.*)(\(|%28) [NC]    
RewriteRule . - [F,L]    

RewriteCond %{REQUEST_URI} !(7g_log.php) [NC]    
RewriteCond %{HTTP_USER_AGENT} ([a-z0-9]{2000,}) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (&lt;|%0a|%0d|%27|%3c|%3e|%00|0x00) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} ((c99|php|web)shell|remoteview|site((.){0,2})copier) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (base64_decode|bin/bash|disconnect|eval|lwp-download|unserialize|\\\x22) [NC,OR]
RewriteCond %{HTTP_USER_AGENT} (360Spider|acapbot|acoonbot|ahrefs|alexibot|archive.org|asterias|attackbot|backdorbot|becomebot|binlar|blackwidow|blekkobot|blexbot|blowfish|bullseye|bunnys|butterfly|careerbot|casper|checkpriv|cheesebot|cherrypick|chinaclaw|choppy|clshttp|cmsworld|copernic|copyrightcheck|cosmos|crescent|cy_cho|datacha|demon|diavol|discobot|dittospyder|dotbot|dotnetdotcom|dumbot|emailcollector|emailsiphon|emailwolf|exabot|extract|eyenetie|feedfinder|flaming|flashget|flicky|foobot|g00g1e|getright|gigabot|go-ahead-got|gozilla|grabnet|grafula|harvest|heritrix|httrack|icarus6j|jetbot|jetcar|jikespider|kmccrew|leechftp|libweb|linkextractor|linkscan|linkwalker|loader|miner|mj12bot|majestic|mechanize|morfeus|moveoverbot|netmechanic|netspider|nicerspro|nikto|ninja|nutch|octopus|pagegrabber|planetwork|postrank|proximic|purebot|pycurl|python|queryn|queryseeker|radian6|radiation|realdownload|rogerbot|scooter|seekerspider|semalt|seznambot|siclab|sindice|sistrix|sitebot|siteexplorer|sitesnagger|skygrid|smartdownload|snoopy|sosospider|spankbot|spbot|sqlmap|stackrambler|stripper|sucker|surftbot|sux0r|suzukacz|suzuran|takeout|teleport|telesoft|true_robots|turingos|turnit|vampire|vikspider|voideye|webleacher|webreaper|webstripper|webvac|webviewer|webwhacker|winhttp|wwwoffle|woxbot|xaldon|xxxyy|yamanalab|yioopbot|youda|zeus|zmeu|zune|zyborg) [NC]    
RewriteRule . - [F,L]

RewriteCond %{REQUEST_URI} !(7g_log.php) [NC]    
RewriteCond %{REMOTE_HOST} (163data|amazonaws|colocrossing|crimea|g00g1e|justhost|kanagawa|loopia|masterhost|onlinehome|poneytel|sprintdatacenter|reverse.softlayer|safenet|ttnet|woodpecker|wowrack) [NC]    
RewriteRule . - [F,L]

RewriteCond %{REQUEST_URI} !(7g_log.php) [NC]    
RewriteCond %{HTTP_REFERER} (semalt.com|todaperfeita) [NC,OR]
RewriteCond %{HTTP_REFERER} (ambien|blue\spill|cialis|cocaine|ejaculat|erectile|erections|hoodia|huronriveracres|impotence|levitra|libido|lipitor|phentermin|pro[sz]ac|sandyauer|tramadol|troyhamby|ultram|unicauca|valium|viagra|vicodin|xanax|ypxaieo) [NC]
RewriteRule . - [F,L]

RewriteCond %{REQUEST_URI} !(7g_log.php) [NC]    
RewriteCond %{REQUEST_METHOD} ^(connect|debug|delete|move|put|trace|track) [NC]    
RewriteRule . - [F,L]

RewriteCond %{REQUEST_METHOD} .* [NC]
RewriteCond %{THE_REQUEST}  (YesThisIsAReallyLongRequest|ScanningForResearchPurpose) [NC,OR]
RewriteCond %{QUERY_STRING} (YesThisIsAReallyLongRequest|ScanningForResearchPurpose) [NC]
RewriteRule .* - [F,L]
</IfModule>

Options -Indexes

<Files .htaccess>
order allow,deny
deny from all
</Files>

<files error_log>
    Order allow,deny
    Deny from all
</files>

<IfModule mod_headers.c>
	Header set Connection keep-alive
	Header set Referrer-Policy "no-referrer"
	Header set X-Frame-Options "sameorigin"
	Header set X-XSS-Protection "1; mode=block"
	Header set X-Content-Type-Options "nosniff"
	Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
	Header set Expect-CT "enforce, max-age=21600"
    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js|gif|png|jpe?g|svg|svgz|ico|webp)$">
        Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
    <FilesMatch "\.(ico|pdf|flv|swf|js|css|gif|png|jpg|jpeg|txt)$">
        Header set Cache-Control "max-age=2592000, public"
    </FilesMatch>
    <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary Accept-Encoding
    </FilesMatch>
    <FilesMatch ".(js|css|xml|gz|html|woff|woff2|ttf)$">
        Header append Vary: Accept-Encoding
    </FilesMatch>
</IfModule>

<IfModule mod_expires.c>
    ExpiresActive on
    ExpiresDefault "access plus 1 month"
    ExpiresByType text/css "access plus 1 year"
    ExpiresByType application/atom+xml "access plus 1 hour"
    ExpiresByType application/rdf+xml "access plus 1 hour"
    ExpiresByType application/rss+xml "access plus 1 hour"
    ExpiresByType application/json "access plus 0 seconds"
    ExpiresByType application/ld+json "access plus 0 seconds"
    ExpiresByType application/schema+json "access plus 0 seconds"
    ExpiresByType application/vnd.geo+json "access plus 0 seconds"
    ExpiresByType application/xml "access plus 0 seconds"
    ExpiresByType text/xml "access plus 0 seconds"
    ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
    ExpiresByType image/x-icon "access plus 1 week"
    ExpiresByType text/html "access plus 3600 seconds"
    ExpiresByType application/javascript "access plus 1 year"
    ExpiresByType application/x-javascript "access plus 1 year"
    ExpiresByType text/javascript "access plus 1 year"
    ExpiresByType application/manifest+json "access plus 1 week"
    ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
    ExpiresByType text/cache-manifest "access plus 0 seconds"
    ExpiresByType audio/ogg "access plus 1 month"
    ExpiresByType image/bmp "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/svg+xml "access plus 1 month"
    ExpiresByType image/webp "access plus 1 month"
    ExpiresByType video/mp4 "access plus 1 month"
    ExpiresByType video/ogg "access plus 1 month"
    ExpiresByType video/webm "access plus 1 month"
    ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
    ExpiresByType font/eot "access plus 1 month"
    ExpiresByType font/opentype "access plus 1 month"
    ExpiresByType application/x-font-ttf "access plus 1 month"
    ExpiresByType application/font-woff "access plus 1 month"
    ExpiresByType application/x-font-woff "access plus 1 month"
    ExpiresByType font/woff "access plus 1 month"
    ExpiresByType application/font-woff2 "access plus 1 month"
    ExpiresByType text/x-cross-domain-policy "access plus 1 week"

    <IfModule mod_headers.c> 
        Header unset ETag 
    </IfModule> 
    FileETag None
</IfModule>

<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/vtt 
    AddOutputFilterByType DEFLATE text/x-component
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/js
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/x-httpd-php
    AddOutputFilterByType DEFLATE application/x-httpd-fastphp
    AddOutputFilterByType DEFLATE application/atom+xml 
    AddOutputFilterByType DEFLATE application/json
    AddOutputFilterByType DEFLATE application/ld+json 
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject 
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/font-woff2
    AddOutputFilterByType DEFLATE application/x-font-woff
    AddOutputFilterByType DEFLATE application/x-web-app-manifest+json font/woff
    AddOutputFilterByType DEFLATE font/woff 
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon 
    SetEnvIfNoCase REQUEST_URI \.(?:gif|jpg|jpeg|png|svg)$ no-gzip dont-vary
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
    Header append Vary User-Agent env=!dont-vary
</IfModule>

# 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 php7_module>
#   php_flag display_errors On
#   php_value max_execution_time 30
#  php_value max_input_time 60
#   php_value max_input_vars 1000
#   php_value memory_limit 128M
#   php_value post_max_size 8M
#   php_value session.gc_maxlifetime 1440
#   php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
#   php_value upload_max_filesize 2M
#   php_flag zlib.output_compression On
#</IfModule>
#<IfModule lsapi_module>
#   php_flag display_errors On
#   php_value max_execution_time 30
#   php_value max_input_time 60
#   php_value max_input_vars 1000
#   php_value memory_limit 128M
#   php_value post_max_size 8M
#   php_value session.gc_maxlifetime 1440
#   php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
#   php_value upload_max_filesize 2M
#   php_flag zlib.output_compression On
#</IfModule>
# END cPanel-generated php ini directives, do not edit

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

#redirect http to https

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