Setup Hide My WP on Amazon AWS Lightsail
December 15, 2020

This tutorial has moved to the new WP Ghost Knowledge Base where each feature is presented in detail.
WP Ghost (formerly Hide My WP Ghost) works on Amazon AWS Lightsail (Bitnami WordPress) with extra Apache configuration. Bitnami sets AllowOverride None by default and uses htaccess.conf files instead of .htaccess. You have two options: enable AllowOverride All (recommended, one-time setup) or add rewrite rules directly to Bitnami’s config file.
Why AWS Lightsail (Bitnami) Requires Extra Setup
Bitnami WordPress stacks on Lightsail use a custom Apache configuration that disables .htaccess processing by default for performance reasons. WP Ghost needs rewrite rules to function. Without AllowOverride All, WP Ghost cannot write to .htaccess and the custom paths will not work. The WordPress-specific config file is located at /opt/bitnami/apps/wordpress/conf/httpd-app.conf (legacy layout) or within the Bitnami Apache config directory (newer layout).
Set Up WP Ghost on Amazon AWS Lightsail (Bitnami WordPress)
This is the simplest approach. It enables standard .htaccess support so WP Ghost writes rewrite rules automatically, just like any standard Apache server. It also enables WordPress permalink support and compatibility with other plugins that use .htaccess.
SSH into your Lightsail instance (use the browser-based SSH client in the Lightsail console or your own SSH client). Open the config file:
sudo nano /opt/bitnami/apps/wordpress/conf/httpd-app.confFind the <Directory> block and change AllowOverride None to AllowOverride All:
<Directory "/opt/bitnami/apps/wordpress/htdocs">
Options +MultiViews +FollowSymLinks
AllowOverride All
<IfDefine USE_PHP_FPM>
<FilesMatch \.php>
SetHandler "proxy:fcgi://wordpress-fpm/"
</FilesMatch>
</IfDefine>
</Directory>Save with Ctrl + X, then Y, then Enter.
Option B: Add Rules Directly to httpd-app.conf
If you prefer to keep AllowOverride None for performance, you can add WP Ghost’s rewrite rules directly to the Bitnami config file instead of using .htaccess.
Install WP Ghost, select Safe Mode or Ghost Mode, and click Save. WP Ghost displays a notification with the rewrite rules. Copy these rules. SSH into your Lightsail instance, open the config file, and add the rules inside the <Directory> block before the existing WordPress rewrite rules.
<Directory "/opt/bitnami/apps/wordpress/htdocs">
Options +MultiViews +FollowSymLinks
AllowOverride None
# Example of Hide My WP Ghost code generated. Change it with the real code
RewriteRule ^([_0-9a-zA-Z-]+/)?admin/ajax(.*) /wordpress/wp-admin/admin-ajax.php$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?admin/(.*) /wordpress/wp-admin/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?login(.*) /wordpress/wp-login.php$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?login/(.*) /wordpress/wp-login.php$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?modules/(.*) /wordpress/wp-content/plugins/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?assets/(.*) /wordpress/wp-content/themes/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?storage/(.*) /wordpress/wp-content/uploads/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?core/(.*) /wordpress/wp-content/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?lib/(.*) /wordpress/wp-includes/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?comments/(.*) /wordpress/wp-comments-post.php$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?writer/(.*) /wordpress/author/$2 [QSA,L]
#####################################
#This is the code from your .htaccess file where the wordpress is installed
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [S=1]
# end of Hide My WordPress Ghost code
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
############################################################### End of WordPress code
<IfDefine USE_PHP_FPM>
<FilesMatch \.php>
SetHandler "proxy:fcgi://wordpress-fpm/"
</FilesMatch>
</IfDefine>
</Directory>With Option B, you need to update the rules in httpd-app.conf every time you change paths in WP Ghost. With Option A, WP Ghost writes to .htaccess automatically.
Restart Apache and Test
After either option, restart Apache:
sudo /opt/bitnami/ctlscript.sh restart apacheThen activate WP Ghost in Safe Mode or Ghost Mode from WP Ghost > Change Paths > Level of Security. Run the Frontend Test to confirm all paths load correctly. If everything works, click “Yes, it’s working”.
Troubleshooting
Config file path does not exist. Bitnami updated its directory layout. The legacy path is /opt/bitnami/apps/wordpress/conf/httpd-app.conf. Newer stacks use /opt/bitnami/apache/conf/vhosts/. Check the Bitnami documentation for your stack version.
Custom paths return 404 after restart. Verify AllowOverride All is set (Option A) or that rewrite rules are placed before the WordPress rules (Option B). Confirm Apache restarted without errors by running sudo /opt/bitnami/ctlscript.sh status apache.
Apache will not restart. There is a syntax error in the config file. Check Apache’s error log at /opt/bitnami/apache/logs/error_log for the specific error and line number.
Locked out after configuration. Use the Safe URL parameter or the Emergency Disable guide.
Frequently Asked Questions
Which option should I choose?
Option A (AllowOverride All) for most users. It is a one-time setup, WP Ghost writes rules automatically, and you never need to SSH in again for path changes. Option B is for advanced users who want to keep AllowOverride None for marginal performance gains and are comfortable with manual SSH updates.
Is this a one-time setup?
With Option A, yes. AllowOverride All persists across Apache restarts. WP Ghost manages .htaccess from that point on. With Option B, you need to SSH in and update the config every time you change WP Ghost paths.
Does this apply to other Bitnami platforms (Azure, Google Cloud)?
Yes. Bitnami WordPress stacks use the same Apache configuration on all cloud platforms. The fix is identical: enable AllowOverride All or add rules to httpd-app.conf. The exact file path may differ slightly by platform version.
Does WP Ghost modify WordPress core files?
No. WP Ghost writes rewrite rules to .htaccess (Option A) or you add them to the Bitnami config (Option B). No core files are modified.
Related Tutorials
Set AllowOverride All on Apache – general Apache AllowOverride guide.
Google Cloud Platform Setup – similar setup for Google Cloud.
Theme Not Loading Correctly – troubleshoot path issues across server types.
Emergency Disable Guide – recovery via SSH if needed.
Customize All WordPress Paths – configure paths after server setup.