András Tóth
András Tóth

Reputation: 53

Wordpress pages not loading, after migrating to new host

I've migrated my wordpress sites to a new host. Migrated the database correctly, changed .htaccess and wp-config. The homepage of the site loading perfectly fine. But when I click on any of the pages they aren't working.

The directory is

.../public_html/directory_name/site/

and when I click a page it fallsback to

.../public_html/directory_name/index.php.

It happens to all pages including admin/login page. I've already migrated 4 websites, and this happened on 3 of them.

Tried to look other questions and information, but I'm not able to find what couses this problem.

What could be the reason behind it? I can provide any source code / information if needed.

UPDATE:

So I've managed to fix the problem!

Upvotes: 1

Views: 5990

Answers (2)

Kishore
Kishore

Reputation: 612

I think you facing http://yoursite but http://yoursite/anything

I had a similar problem and it got resolved when I follow these steps.

Step 1: change modification in 000-default.conf file, file path /etc/apache2/sites-available

Add these lines

 <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Require all granted
 </Directory> 

like this

<VirtualHost *:80>
  ServerAdmin webmaster@localhost
  DocumentRoot /var/www/html

         <Directory /var/www/html>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Require all granted
        </Directory>

  ErrorLog ${APACHE_LOG_DIR}/error.log
  CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

for more see See https://httpd.apache.org/docs/current/upgrading.html

Step 2: It seems mod_rewrite is not enabled in your server. Enable the module with the a2enmod command (which creates a symbolic link /etc/apache2/mods-enabled/rewrite.load pointing to ../mods-available/rewrite.load), then restart the server:

sudo a2enmod rewrite
sudo service apache2 restart

To list all enabled modules you can use the a2query command with the -m flag:

a2query -m

Upvotes: 1

sajad abbasi
sajad abbasi

Reputation: 2184

If you have changed the domain you should follow these steps:

1.Go to the database, for example, PHPMyAdmin and replace everything with your last domain with the new domain.

2.In the .htacceess file and change if there is the old domain.

3.If any plugin does not let you login change the folder name in the file manager.

Upvotes: 0

Related Questions