JezK
Edit File: .htaccess
RewriteOptions inherit RewriteEngine On # 1) REDIRECT HTTP TO HTTPS (Untuk semua domain) RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # 2) REDIRECT NON-WWW MHA.ASIA KE WWW.MAHA.ASIA (ODOO) RewriteCond %{HTTP_HOST} ^maha\.asia$ [NC] RewriteRule ^(.*)$ https://www.maha.asia/$1 [R=301,L] # 3) REDIRECT MAHACHEM.COM KE WWW.MAHA.ASIA # 4) REDIRECT DOMAIN LAIN YANG PERLU RewriteCond %{HTTP_HOST} ^chem\-on\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.chem\-on\.com$ RewriteRule ^(.*)$ https://chem\-on\.com\.sg/$1 [R=301,L] # 5) CEGAH DIRECT ACCESS KE SITEMAP.XML DI NON-WWW RewriteCond %{HTTP_HOST} ^maha\.asia$ [NC] RewriteRule ^sitemap\.xml$ https://www.maha.asia/sitemap.xml [R=301,L] RewriteCond %{HTTP_HOST} ^maha\.asia$ [NC] RewriteRule ^sitemap_index\.xml$ https://www.maha.asia/sitemap_index.xml [R=301,L] # 6) CEGAH DIRECT ACCESS KE ROBOTS.TXT DI NON-WWW RewriteCond %{HTTP_HOST} ^maha\.asia$ [NC] RewriteRule ^robots\.txt$ https://www.maha.asia/robots.txt [R=301,L] # 7) WordPress Rules (jika ada WordPress di hosting ini) # BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress # 8) PHP Configuration <IfModule php7_module> php_flag display_errors Off php_value max_execution_time 300 php_value max_input_time 60 php_value max_input_vars 1000 php_value memory_limit 256M php_value post_max_size 50M php_value session.gc_maxlifetime 1440 php_value session.save_path "/var/cpanel/php/sessions/ea-php71" php_value upload_max_filesize 50M php_flag zlib.output_compression Off </IfModule> <IfModule lsapi_module> php_flag display_errors Off php_value max_execution_time 300 php_value max_input_time 60 php_value max_input_vars 1000 php_value memory_limit 256M php_value post_max_size 50M php_value session.gc_maxlifetime 1440 php_value session.save_path "/var/cpanel/php/sessions/ea-php71" php_value upload_max_filesize 50M php_flag zlib.output_compression Off </IfModule> # 9) Security & Additional Settings <Files 403.shtml> order allow,deny allow from all </Files> # 10) PHP Handler <IfModule mime_module> AddHandler application/x-httpd-ea-php74___lsphp .php .php7 .phtml </IfModule> RewriteCond %{HTTP_HOST} ^mahachem\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.mahachem\.com$ RewriteRule ^/?$ "https\:\/\/maha\.asia\/" [R=301,L] deny from 180.254.75.244 deny from 144.76.68.17 deny from 182.8.212.130 # php -- BEGIN cPanel-generated handler, do not edit # Set the “alt-php74” package as the default “PHP” programming language. <IfModule mime_module> AddHandler application/x-httpd-alt-php74___lsphp .php .php7 .phtml </IfModule> # php -- END cPanel-generated handler, do not edit