Question

unable to publish content on wordpress after moving WP to virtual host folder

Posted December 17, 2018 1.6k views
ApacheWordPressUbuntu 18.04

Hi there,
-I created a droplet using the WordPress one-click installation on ubuntu 18.04
-I secured it with SSH Keys.
-I secured my site with SSL certificate from Let’s encrypt
-Prior to that, I created a virtual host file and moved the site to a virtual host folder, following these tutoials:

https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-18-04#step-4-%E2%80%94-obtaining-an-ssl-certificate

https://www.digitalocean.com/community/tutorials/how-to-install-the-apache-web-server-on-ubuntu-18-04#step-5-%E2%80%94-setting-up-virtual-hosts-(recommended)

Finally, I managed to enable secure WordPress updates, following this tutorial:
https://www.digitalocean.com/community/tutorials/how-to-configure-secure-updates-and-installations-in-wordpress-on-ubuntu

Everything OK so far. (I’m able to update WordPress; install activate and deactivate plugins, upload images, install activate and deactivate themes.)

The only problem I have is that I’m unable to write content on WordPress (create or update entries or pages).
Whenever I try to create or update any content on my WordPress admin, it fails. I cannot even save my drafts.

The console of my browser shows 404 errors and it seems it have to do with this . api-fetch.min.js?ver=2.2.5:1

At first, I thought it was something to do with permissions, but I discarded that since I gave 755 permissions to the www-data user and www-data group to the host folder and indeed I must have access from my wp admin page (otherwise, I wouldn’t be able to upload images or install and activate plugins)

I think my trouble has something to do with the virtual host I created. Something I didn’t configure properly,

I tried setting up my .htaccesss file, following this tutorial https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory (without url change)

Nothing has worked so far. So frustrating..
what am I doing wrong?

Please, I’d deeply appreciate your help.

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.

×
1 answer

Hey friend,

If I had to guess, I’d bet that your Wordpress site URL is misconfigured. Check out this guide and make sure that the URL is configured properly in the instance:

https://codex.wordpress.org/Changing_The_Site_URL

Jarland

Submit an Answer