Servers

Enable AllowOverwrite on Google Cloud Platform

If you deploy a WordPress website on Google Cloud Hosting, you should know that AllowOverwrite is None by default, and you can’t use the .htaccess for caching and security filters.

To make WP Ghost work on the Google Cloud Platform, just follow the next steps to activate the rewrite rules:

Enable mod_rewrite in Apache

There are many ways to enable mod_rewrite if it’s not yet enabled by Google Cloud. You can find some answers here: How to enable mod_rewrite for Apache 2.2.

It’s not hard to set up Apache on Google. All you need to do is access the SSH built into your Google Cloud Platform Deployment Manager and follow the command-line actions. 

Once you click on the SSH button, the Google SSH console will load. To check if mod_rewrite is enabled in Apache, run this command: 

$: a2enmod rewrite

Enable Apache AllowOverride

To enable the .htaccess rewrites, you need to edit /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>

Save the file changes with Ctrl + X and then press Y .

Restart Apache Service

After you’ve made that change, make sure to restart the server:

sudo service apache2 restart

Now, your .htaccess should work and you can use caching and security filters and activate WP Ghost to hide the WordPress common paths.

Test New Paths & Settings

  1. Perform a Frontend Test to ensure the paths are loading correctly. Also, visit your website and check if the paths are working as intended.
  2. If everything loads fine, click the Yes, it’s working button in the WP Ghost settings.
  3. If there are any issues, click No, abort to roll back to previous settings.
John Darrel

Change Database Prefix in WordPress

Because hackers often use bots to search for security flaws in your website, it is…

1 year

Customize WordPress Uploads Directory

The easiest way to change the default media uploads path is to use the WP…

1 year

WP Ghost and WP Rocket Cache

To hide all CSS and JS you need to follow the steps to Combine the…

1 year

Why is website security important?

https://youtu.be/6ylhojSi-_E In this video, we’ll explore why website security matters and what can happen if…

1 year

Is WordPress Website Easily Hacked?

The security of your WordPress site depends on multiple factors, such as the strength of…

1 year

Setting up Two-Factor Authentication (2FA) for WordPress Using Mobile Apps

When you enable two-factor authentication (2FA) for your WordPress website, it adds an extra layer…

1 year