My apologies if this question seems noob-ish. It will be a great help if anyone can solve my problem.
I have hosted a site on mochahost and while using an ftp client, .htaccess file accidentally got deleted. Now when I try to use the Contact Form, it gives the following error, this was working when the .htaccess file was there:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This is the Error Log I found using cPanel:
[Fri Feb 23 03:03:11 2018] [error] [client 45.115.84.90] File does not exist: /home/user/public_html/404.shtml, referer: http://hostedsite.com/index.php [Fri Feb 23 03:03:11 2018] [error] [client 45.115.84.90] File does not exist: /home/user/public_html/favicon.ico, referer: http://hostedsite.com/index.php [Fri Feb 23 03:03:10 2018] [error] [client 45.115.84.90] File does not exist: /home/user/public_html/500.shtml, referer: http://hostedsite.com/Update:
Mochahost support asked me to use Pear Mail client, and I’ve also found this Error in the log of public_html directory:
2
Answers
Turned out that I was severely misguided by the mochahost support when the told me that I MUST use pear mail, otherwise mail won't go through. Then they refused to help me that this is custom code so they can't do anything and that too was the same code they referred to, here is the link: Send Email from a PHP Script Using SMTP Authentication(PEAR)
I asked a seasoned developer and he told me that the problem was in fact in the pear, not the htaccess file. Also, the simple php mail() is enough for this specific scenario and it's working now.
Support means support, mochahost support should investigate the issue first without just ditching the customer almost immediately.
You have to contact Mochahost support team , letting them know this issue and ask them if they can recover the .htaccess file from the backup.