I recently migrated a WordPress based website to EC2. The homepage of the site loads fine but the internal pages show a 404. The site runs Ubuntu 16.04, Apache2, PHP 7.0 and MySQL server 5.7. I’ve installed the site at /var/www/somesitename
.
I’ve tried the solution listed here and this worked for another site but surprisingly it does not work with this particular site. Without adding the lines in /etc/apache2/apach2.conf
mentioned in the above-linked solution, the homepage loads but not the internal pages. If I add those lines, the site tries to load but eventually, I see a could not connect to the database
error. What am I missing here?
EDIT: I’ve also tried updating the permalinks from the WordPress dashboard but that did not work. The rewrite
module is enabled. Also, the site works fine on my notebook in a MAMP environment.
2
Answers
can you reset your permalink too from back end Settings -> Permalink -> Post name
How did you migrate the website? Did you set the settings in wp-config.php to be able to connect to the new database?
I mean these fields:
define('DB_NAME', 'insertdbnamehere');
define('DB_USER', 'insertdbuserhere');
define('DB_PASSWORD', 'insertpwhere');
define('DB_HOST', 'inserthostnamehere');
wp_config.php
is located in the WordPress root of your site, in the FTP. Next to thewp-content
,wp-admin
andwp-includes
directories.