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.
Ā 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 </Directory>
4) Change this line
AllowOverride None
with
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Ā
thank u sir your tips is great i am suffer very frustetd before 5 days but now i am fine your post is 100% working