skip to Main Content

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


  1. can you reset your permalink too from back end Settings -> Permalink -> Post name

    Login or Signup to reply.
  2. 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:

    1. define('DB_NAME', 'insertdbnamehere');

    2. define('DB_USER', 'insertdbuserhere');

    3. define('DB_PASSWORD', 'insertpwhere');

    4. define('DB_HOST', 'inserthostnamehere');

    wp_config.php is located in the WordPress root of your site, in the FTP. Next to the wp-content, wp-admin and wp-includes directories.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search