RewriteEngine On
ErrorDocument 404 https://fandarintl.com/extra/error-404.php
ErrorDocument 500 https://fandarintl.com/extra/error-500.php
#RewriteCond %{HTTP_HOST} !^www\.
#RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteRule    ^home.html?$	                                        index.php 	                [QSA,NC,L]
RewriteRule    ^products.html?$	                                    products.php 	            [QSA,NC,L]
RewriteRule    ^search.html?$	                                        search.php 	                [QSA,NC,L]
RewriteRule    ^sitemap.html?$	                                        sitemap.php 	                [QSA,NC,L]
RewriteRule    ^basket.html?$	                                        basket.php 	                [QSA,NC,L]
RewriteRule    ^inquiry.html?$	                                        inquiry.php 	                [QSA,NC,L]
RewriteRule    ^gallery.html?$	                                        gallery.php 	                [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+).html$	products.php?ma=$1         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	products.php?ma=$1&sa=$2         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	products.php?ma=$1&sa=$2&th=$3         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	products.php?ma=$1&sa=$2&th=$3&fo=$4         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	products.php?ma=$1&sa=$2&th=$3&fo=$4&fi=$5         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/page/([0-9]+).html$	products.php?ma=$1&pg=$2         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/page/([0-9]+).html$	products.php?ma=$1&sa=$2&pg=$3         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/page/([0-9]+).html$	products.php?ma=$1&sa=$2&th=$3&pg=$4         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/page/([0-9]+).html$	products.php?ma=$1&sa=$2&th=$3&fo=$4&pg=$5         [QSA,NC,L]
RewriteRule    ^products/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/page/([0-9]+).html$	products.php?ma=$1&sa=$2&th=$3&fo=$4&fi=$5&pg=$6         [QSA,NC,L]
RewriteRule    ^product/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	detail.php?ma=$1&pid=$2         [QSA,NC,L]
RewriteRule    ^product/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	detail.php?ma=$1&sa=$2&pid=$3         [QSA,NC,L]
RewriteRule    ^product/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	detail.php?ma=$1&sa=$2&th=$3&pid=$4        [QSA,NC,L]
RewriteRule    ^product/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	detail.php?ma=$1&sa=$2&th=$3&fo=$4&pid=$5         [QSA,NC,L]
RewriteRule    ^product/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	detail.php?ma=$1&sa=$2&th=$3&fo=$4&fi=$5&pid=$6         [QSA,NC,L]
RewriteRule    ^gallery/([0-9a-zA-Z-]+).html$	                            gallery.php?gid=$1 	        [QSA,NC,L]
RewriteRule    ^page/([0-9a-zA-Z-]+).html$	                            content.php?pid=$1 	        [QSA,NC,L]
RewriteRule    ^page/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	                            content.php?pid=$1&pidd=$2  	        [QSA,NC,L]
RewriteRule    ^page/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).html$	                            content.php?pid=$1&pidd=$2&piddd=$3 	        [QSA,NC,L]
RewriteRule    ^product-image/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+)/([0-9a-zA-Z-]+).webp$	                            uploads/products/watermark.php?type=$1&size=$2&id=$3 	        [QSA,NC,L]

## Force not ssl to ssl
#
#RewriteCond %{HTTPS} off
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#
## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to base64_encode data within the URL.
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
## Block out any script that includes a <script> tag in URL.
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
## Block out any script trying to set a PHP GLOBALS variable via URL.
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
## Block out any script trying to modify a _REQUEST variable via URL.
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
## Return 403 Forbidden header and show the content of the root homepage
RewriteRule .* index.php [F]
#
## End - Rewrite rules to block out some common exploits.
#
## Begin - Security Headers
<ifModule mod_headers.c>
    Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
    Header always set X-Frame-Options "deny"
    Header setifempty Referrer-Policy: same-origin
    Header set X-XSS-Protection "1; mode=block"
    Header set X-Permitted-Cross-Domain-Policies "none"
    Header set Referrer-Policy "no-referrer"
    Header set X-Content-Type-Options: nosniff
    #Header set Content-Security-Policy "default-src 'self' *.googleapis.com *.gstatic.com; font-src 'self' googleapis.com *.googleapis.com *.gstatic.com; style-src 'self' googleapis.com *.googleapis.com; script-src 'self' 'unsafe-hashes' 'sha256-BiTnzhrWNleST4yoMMWpoWxyG1J+obmNLvRx0ENIoH0=' *.google.com *.googleapis.com *.gstatic.com; img-src 'self' gtranslate.net data:; frame-src 'self' *.youtube.com *.google.com;
    Header set Permissions-Policy "geolocation=self"
</ifModule>
## End - Security Headers
#
## Begin Blocking Bots
#
RewriteCond %{HTTP_USER_AGENT} (GbPlugin|Wget|EmailSiphon|EmailWolf|libwww-perl|EvilBotHere|SpamSpewer|SecretAgentAgent|PetalBot|DotBot|SeznamBot|8LEGS|Nimbostratus-Bot|Semrush|Ahrefs|AspiegelBot|AhrefsBot|MauiBot|BLEXBot|Sogou|Go-http-client|MJ12bot|SemrushBot|AhrefsBot|Dalvik) [NC]
RewriteRule (.*) - [F,L]
#
## End - Blocking Bots

# 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 php8_module>
   php_flag display_errors On
   php_value max_execution_time 900
   php_value max_input_time 900
   php_value max_input_vars 3000
   php_value memory_limit 2048M
   php_value post_max_size 256M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php81"
   php_value upload_max_filesize 256M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors On
   php_value max_execution_time 900
   php_value max_input_time 900
   php_value max_input_vars 3000
   php_value memory_limit 2048M
   php_value post_max_size 256M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php81"
   php_value upload_max_filesize 256M
   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-php81” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php81 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
