Switching web hosts

Post suggestions, correct errors or omissions, or anything else about the site
Post Reply
User avatar
DOSGuy
Website Administrator
Posts: 1063
Joined: September 2nd, 2005, 8:28 pm
Contact:

Switching web hosts

Post by DOSGuy »

This site has been hosted by HostGator for many years, but I need to change web hosts immediately. HostGator never had good customer service, but they were cheap and provided adequate hosting. Apparently HostGator (along with Domain.com and Bluehost) were spun off from their parent company in February 2021 and things have been bad ever since.

About a month ago, HostGator upgraded cPanel, which caused the following code to be added to every .htaccess file in every directory:

Code: Select all

# 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
This instructs the server to parse any PHP code that it finds in pages with extensions .php, .php7, and .phtml. It also means that pages with any other extension will not be checked for PHP code. Since this site's pages have .html extensions, PHP code stopped being parsed and the site broke. I had to modify the AddHandler statement to include .html to restore service.

It seems that HostGator has some automated process that checks every .htaccess file once a week to see if the code block is present. If it's been altered, it removes the altered code and puts back the original code. "Do not edit" isn't just a suggestion! You cannot edit this code; HostGator will revert your changes every week. That means that the site stops working every week, and I have to fix it every week.

I talked to Tech Support twice and they created a ticket the second time. The response from the ticket was that I should change my site password to prevent hackers from editing my .htaccess file. I tried to reply that I haven't been hacked by anyone but them, but the ticket was closed. It's more or less impossible to talk to a live agent, and it's pointless to do so because they're so unqualified. I literally had to explain to the last agent what a .htaccess file is!

Put simply, HostGator no longer allows websites to embed PHP code in files with any extension other than .php. They're going to keep breaking the site every week, so I had to find a new web host. There will be some service disruption while I switch hosts.
Today entirely the maniac there is no excuse with the article.
User avatar
MrFlibble
Forum Administrator
Posts: 1814
Joined: December 9th, 2010, 7:19 am

Re: Switching web hosts

Post by MrFlibble »

Good luck, I hope you'll find a better solution!
Malvineous
8-bit mega nerd
Posts: 293
Joined: March 17th, 2007, 6:40 pm
Location: Brisbane, Australia
Contact:

Re: Switching web hosts

Post by Malvineous »

When I last moved shikadi.net I realised that I was only using PHP to make the site simpler to maintain, I didn't actually need a dynamic language to host most of the non-wiki content. So I switched to a static content management application instead. This keeps all the interactive stuff on your local machine, and when you're ready to publish your changes, it "renders" bunch of static HTML you then upload. The advantage of that is that you can host it anywhere that can provide simple file storage, so I stuck it on Amazon S3. Now the site only costs me a few cents a month to host.

I realise that won't work for every site, but just putting it out there as a suggestion for a cheap alternative, if you're willing to redesign certain parts of the site so that the bulk of it is just images, CSS/JS and static HTML files.
User avatar
DOSGuy
Website Administrator
Posts: 1063
Joined: September 2nd, 2005, 8:28 pm
Contact:

Re: Switching web hosts

Post by DOSGuy »

I went with InterServer. It costs less, and they aren't changing my .htaccess files on me.
Today entirely the maniac there is no excuse with the article.
Post Reply