Skip to contentSkip to main navigation Skip to footer

Set Hide My WP Ghost For Bitnami Servers

#1 Bitnami Setup for Apache Servers

Step1: Install, Setup Hide My WP Ghost Plugin and click the Save button with the new paths.

Step2: Copy the rewrite rules from Hide My WP Ghost into Bitnamy config file

Bitnami uses “htaccess.conf” files by default instead of “.htaccess” files for security and performance reasons. You can find more info at https://docs.bitnami.com/general/apps/redmine/administration/use-htaccess/

If you found the config file (it’s usually located at /opt/bitnami/apache/conf/vhosts/wordpress-vhost.conf) you should see something like the following code.  Add the code generated by WordPress in the .htaccess file

<VirtualHost 127.0.0.1:80 _default_:80>
ServerAlias *
DocumentRoot /opt/bitnami/APPNAME
<Directory "/opt/bitnami/APPNAME">
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride None
Require all granted

# Example of Hide My WordPress Ghost code generated. Change it with the real code
#START HIDEMYWP RULES
RewriteRule ^([_0-9a-zA-Z-]+/)?admin/ajax(.*) /wp-admin/admin-ajax.php$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?admin/(.*) /wp-admin/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?login(.*) /wp-login.php$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?login/(.*) /wp-login.php$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?modules/(.*) /wp-content/plugins/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?assets/(.*) /wp-content/themes/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?storage/(.*) /wp-content/uploads/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?core/(.*) /wp-content/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?lib/(.*) /wp-includes/$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?comments/(.*) /wp-comments-post.php$2 [QSA,L]
RewriteRule ^([_0-9a-zA-Z-]+/)?writer/(.*) /author/$2 [QSA,L]

#END HIDEMYWP RULES
#####################################

# This is the code from your .htaccess file where the wordpress is installed
# BEGIN WordPress
# https://wordpress.org/support/article/htaccess/#basic-wp
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
############################################################### End of WordPress code

</Directory>
Include "/opt/bitnami/apache/conf/vhosts/htaccess/wordpress-htaccess.conf"
</VirtualHost>

If it is easier for you, you can enable “.htaccess”. In order to enable “.htaccess” you should add “Allow Override” to your Directories configuration in your VirtualHosts (not in the VirtualHosts directly).

What you have to do is to change from AllowOverride None to AllowOverride All 

The VirtualHost configuration should be something like this:

<VirtualHost 127.0.0.1:80 _default_:80>
ServerAlias *
DocumentRoot /opt/bitnami/APPNAME
<Directory "/opt/bitnami/APPNAME">
Options -Indexes +FollowSymLinks -MultiViews
AllowOverride All
Require all granted
</Directory>
Include "/opt/bitnami/apache/conf/vhosts/htaccess/wordpress-htaccess.conf"
</VirtualHost>

Step3: Now restart the Apache server and it should work.

sudo /opt/bitnami/ctlscript.sh restart apache

You can read more about it at https://community.bitnami.com/t/wordpress-htaccess-permissions-override-on-ami/24408/5


#2 Bitnami Setup for Nginx Servers

Step1: Install, Setup Hide My WP Ghost Plugin and click the Save button with the new paths.

Step2: Copy the config path line for Nginx.

Bitnami Config File Hide My WP

The nginx config file it’s usually located at /opt/bitnami/nginx/conf/server_blocks/myapp-server-block.conf.  You should see something like the following code.

server {
      # Port to listen on, can also be set in IP:PORT format
      listen 80 default_server;
      root /opt/bitnami/myapp;
      # Catch-all server block
      # See: https://nginx.org/en/docs/http/server_names.html#miscellaneous_names
      server_name _;
      include  "/opt/bitnami/nginx/conf/bitnami/*.conf";

      #paste the hidemywp.conf line here:
      include /opt/bitnami/apps/wordpress/htdocs/hidemywp.conf;
}

Step3: Restart the Nginx config through SSH or SFTP to activate the new paths.

Command line:  

sudo /opt/bitnami/ctlscript.sh restart nginx

Step4: Go back to Hide My WP, confirm the change and click to Test Frontend Login.
If the test login is working, you can logout and login again.