After migrating my site, my front page works, but all other pages give a 404 error

First of all: this is not bad. Even though your front page is only one page, if it migrated correctly, then you’re 99% there.

If your front page works, but others give 404, then there’s only one thing missing: a piece of configuration in your webserver. In particular, it’s the configuration for permalinks – the configuration to send access to pretty URLs like www.example.com/about-us/ into WordPress’s actual files on-disk.

Because this is part of the webserver configuration, it’s one level above WordPress, and not under WordPress’s direct control. Therefore, it sometimes needs a small piece of manual intervention from you to get working.

How can I know what webserver my hosting company is using?

It may tell you on your 404 error page. If not, then go to your UpdraftPlus settings page (remember that you’ll need to use the login details from the site you migrated – login details are part of what’s migrated), and click on the ‘Expert / Debugging Tools’ tab. In that tab, towards the top, there should be a line ‘Web server’.

Failing that, you can ask your web hosting company – they’ll know!

Apache and IIS

The vast majority of webservers are Apache. Apache handles this via .htaccess files (a file called .htaccess in the root directory of your WordPress install), and WordPress can almost always set these up automatically. WordPress also can usually set the configuration file for Microsoft IIS webservers (a file called web.config). If it is not happening automatically for you, then firstly visit the Settings -> Permalinks page in your WordPress dashboard, and press the button to save settings. When you do this, WordPress will make a second attempt to set up the file. This probably will not work, if it did not work the first time. But you can try anyway. If it does not work, and you have Apache or IIS, then you should check the file permissions in the root folder of your WordPress install. Does WordPress (or to be more particular, the PHP engine that WordPress runs on) have permission to create files in that directory?

Finally, on Apache, if you are running your own server, then you should also check that: 1) you have the module mod_rewrite enabled and 2) your Apache configuration settings allow .htaccess files to take effect (perhaps, the AllowOverride setting in your main httpd.conf – but, the best place to get Apache support is in an Apache/XAMMP/MAMP/Bitnami etc. forum, for such issues). WordPress relies on mod_rewrite being available, and .htaccess files being allowed to take effect. (If you are using web hosting, then it is extremely unlikely to not be enabled/in effect already). Depending on how you have installed Apache, mod_rewrite might be called rewrite_module, or something similar.

Other webservers

If your webserver is not Apache or IIS (e.g. is one of the others – nginx, Zeus, lighttpd, LiteSpeed, or some other product), then you are likely to need to do something manually to set up the permalinks. Here are some links that may help; if they don’t, they just try Googling – e.g. Google for something like ‘WordPress permalinks lighttpd’.

Posted in: Migration, Troubleshooting

twitterlinkedinFacebook