Others Web Development

Fix WordPress 404 Permalinks on Google Cloud Platform

If this is the first time you start hosting your WordPress site on Google Cloud Platform, changing permalinks structure will cause all your posts to be 404 not found. This because you need to allow the .htaccess file to overwrite in the Apache configuration.

Don’t worry, it’s not that difficult and can be done in just a couple minutes!

Editing Apache Config

1) Let’s start with open SSH connection to your VM instance by clicking the SSH button on Google Computing Engine Dashboard.

fix-wordpress-404-google-cloud-1Ā 2) Then open apache.conf file using this command

$sudo nano /etc/apache2/apache.conf

3) File will be opened in the editor.


Use Down Arrow to find the block below

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

4) Change this line

AllowOverride None


AllowOverride All

Then save the file by pressing CTRL+X, type y and enter.

5) Enable mod_rewrite by type the command below

$ sudo a2enmod rewrite

6) Done! Restart the Apache server using this command

$ sudo service apache2 restart

And that’s it! Enjoy šŸ™‚ If you love to see more of development tips and tutorial, like ourĀ FacebookĀ and subscribe ourĀ YoutubeĀ Channel to stay tune. Thanks for visitingĀ ?


One comment

Leave a Reply

Your email address will not be published. Required fields are marked *