RewritEengine on
Options +FollowSymlinks
DirectoryIndex main.php
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://api.negahub.com/$1 [r=301,nc]
RewriteRule ^main\.php - [L]
#if other php file called(user typed it in), redirect to extensionless uri
RewriteCond %{THE_REQUEST} ^GET\ /(.+)\.php
RewriteRule ^ /%1? [R=302,L]
#if extensionless uri maps to a real php file, forward to main.php
RewriteCond %{DOCUMENT_ROOT}/$1\.php -f [OR]
#or if not a real file or directory forward to main.php
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteRule ^([\s\S]*)$ main.php [L,NC,B]

# 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 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
