In their defense, 000webhost offers an okay product, but unfortunately their generosity is often abused leading to their domains being blacklisted for things done on their servers.
This is sadly what happened to my podcast’s site, which is now banned from Facebook:
Anyway, back to the point. After migrating my WordPress site, I noticed that there were issues with my custom URLs that were leading to the 404 page. It took my a couple hours, but I finally figured it out.
Step 1 – Super important!
The absolute first step you have to do is launch rewrite in Apache. This was the thing that I was missing. To do this, SSH into your server and enter:
sudo a2enmod rewrite
Then reset apache by entering:
Step 2 – AllowOverride All
Since my server hosts multiple domains, this step might vary, but in Apache there is a file called httpd.conf in /etc/apache2/ which does a lot of magical jibberish. If you have multiple domains, this magical jibberish file is actually located in /etc/apache2/sites-available/___yourdomain___.
You’ll know you’ve found the right file when the first line in that file is:
In side that file, find every instance of “AllowOverride” and turn it into “AllowOverride All”.
Save the file, then reset Apache again by entering:
Step 3 – Optional – Change your permissions of .htaccess
So you may or may not have to do this step. First go to Settings > Permalinks. Select any link format that isn’t the default then save. If it says “If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file”, you’ll have to edit the file permissions of the .htaccess file.
The easiest way is to FTP into your directory, right click on .htaccess and change the number from whatever to “777”. Then, go back into that permalinks page, select your custom field and click okay. It will edit (or generate if you don’t already have one) a .htaccess file.
After that you MUST change your permissions back to “644”. I cannot stress that enough. YOU MUST CHANGE PERMISSIONS BACK TO 644 OR YOUR WORDPRESS INSTALL WILL HAVE A SECURITY HOLE.
If you need to do it using the command line, I’m sure you can easily google a way to do that.
That’s it! Enjoy your new custom links!
Thanks a lot to Digital Ocean for providing me with Step 1 and everyone on the WordPress forums for the remaining steps.