Getting 404 Error on every post, pages after migrating to Ubuntu 18.04


I am new in Ubuntu, I was using shared host before…

I have just migrated my website on Ubuntu 18.04 it is successfully migrated and working fine. But when I try to open and post or page it is showing 404 Not Found error.

I was thinking that it was because of database but it is not becasuse if it is database problem then it will show error establishing database.

Can anyone guide me to solve this?


If it is Apache, make sure .htaccess exist

Go to WordPress > re-save permalink.


already did, Not working


Then may be Server configuration would be wrong.

I would suggest hiring professional who can assist.

  • I am not available today.

Would recommend


I will need access to server … This is probably a rewrite issue.


Hey, do you use Anydesk? I am ready to give you server access


Just email your server’s login credentials to or I can give You my public key on request!

I don’t work on client systems.


Can you guide me? How to fix i?


You just need to check if Your mod_rewrite (in case of Apache 2) is enabled and working.
Then You need to allow overrides in the apache config.


Or if it is nginx, It’s really hard to explain but you gotta check that it is properly forwarding request to php-fpm


Can you please do this on my system, because I can’t provide my credentials and the second imp reason is I want to learn?


Well, I kinda charge for that kind of stuff and I’m not here for free tutorials so the best that I can do for you is to ssh into it, look into the issue and fix it…

If you want me to do it on your system, you kinda have to pay me for that.


are you talking about this…

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

if yes then I did it already…

How much amt will you charge for that?


Well, that’s only one part. Did you restart apache afterwards?

sudo service apache2 restart ??

And You’ll have to email me for any pricing. I don’t post my rates publically.

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
 <Directory /var/www/html>
    Options -Indexes
 ServerSignature Off
   ServerTokens Prod

And yes I restart…
This is the complete part, I hope… You can message me the charges becuase I tried to DM you but you are not accepting dm.


Add the allow overrides to /var/www/html block and then restart that’ll probably fix it

Assuming that your WordPress lives in /var/www/html directory





I aready did this but still getting same error.


Something says me this is still very incorrect!

Why are you using double quotes around your directory name?

Are you editing your 000-default.conf or the apache2.conf ??


I am editing 000-default.conf file

Should I remove them?