Question

After migrating wordpress to digital ocean, only homepage and admin work

Hello, I have been having an issue with my WordPress site that I have just migrated from a local server. The homepage and the admin pages work, but none of the other pages work. they all return a 404 not found error. I have checked that the permalinks are properly set up. I can edit the pages, and it displays the proper permalinks on the admin side. This is my htaccess file

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

is there anything wrong here? I’ve enabled mod_rewrite in apache. Any suggestions are greatly appreciated!

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

<IfModule mod_rewrite.c>

Please make sure your mod rewrite is enabled and that you allow override in the vhost for the site.

https://www.digitalocean.com/community/tutorials/how-to-set-up-mod_rewrite

Provide your site URL + likely someone can assist you.

@tommyconner96

From the CLI, please run:

tail -20 /var/log/apache2/error.log

Once you execute that command, copy and paste the output to a code block as you did with your .htaccess file. We can then take a closer look to see if there’s anything being logged that’ll help us to find the cause of the issue.