Whenever I create a new WordPress blog on Google Cloud and then try to edit the permalinks it gives an INTERNAL SERVER ERROR.
This happens in every Google Cloud deployment of WordPress.
The reason is because you need to Enable mod-rewrite in Apache because the .htaccess files need to do what it needs to do. Here is now to fix it.
Step 1) Make sure you have enabled mod_rewrite in apache. This can be done by going through Compute Engine>VM Instances > identify the correct instance and to the far right on the line will be SSH. Click it and it will take you securely inside a command line interface. Run this command:
$: a2enmod rewrite
Enable Apache AllowOverride
2) Check your virtualhost configuration in /etc/apache2/apache2.conf and make sure that it is configured with
AllowOverride All instead of the default
AllowOverride None for your web root directory. This tells apache it is ok for settings in .htaccess files to override settings. Use this command to modify the file.
sudo nano /etc/apache2/apache2.conf
Once you're in there, find the right spot and change it.
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride ALL <----(edit from none) Require all granted </Directory>
After you’ve made that change, make sure to restart the server:
sudo service apache2 restart
.htaccessshould work. You can also make this change inside a virtual host, which would normally be preferable, but that depends on the way Apache is set up.