Set AllowOverride All on Apache for WP Ghost (Ubuntu and CentOS)
June 6, 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) requires AllowOverride All in Apache’s configuration so .htaccess rewrite rules can function. Without it, WP Ghost’s custom paths return 404 errors. This guide covers setting AllowOverride All on Ubuntu (Debian) and CentOS (RHEL) servers, plus a safety check before restarting Apache.
Ubuntu / Debian Server
Edit the Apache configuration file:
sudo nano /etc/apache2/apache2.confFind the <Directory> block for your WordPress installation directory (typically /var/www/ or /var/www/html/) and change AllowOverride None to AllowOverride All:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>Enable the rewrite module (required for .htaccess rules):
sudo a2enmod rewriteTest the configuration for syntax errors before restarting:
sudo apache2ctl configtestIf the output shows Syntax OK, restart Apache:
sudo service apache2 restartCentOS / RHEL / AlmaLinux Server
Edit the Apache configuration file:
sudo nano /etc/httpd/conf/httpd.confFind the <Directory> block for your WordPress directory (typically /var/www/html/) and change AllowOverride None to AllowOverride All:
<Directory "/var/www/html">
AllowOverride All
</Directory>Test the configuration for syntax errors:
sudo httpd -tIf the output shows Syntax OK, restart Apache:
sudo systemctl restart httpdVerify .htaccess Is Working
After restarting, verify that .htaccess rewrite rules are being processed. See the Make Sure .htaccess Is Working guide for detailed verification steps.
Then activate WP Ghost in Safe Mode or Ghost Mode from WP Ghost > Change Paths > Level of Security and run the Frontend Test to confirm all paths load correctly.
Troubleshooting
WP Ghost paths still return 404 after setting AllowOverride All. The mod_rewrite module may not be enabled. Run sudo a2enmod rewrite (Ubuntu) and restart Apache. On CentOS, mod_rewrite is typically included by default. Also verify you edited the correct <Directory> block – the path must match your WordPress installation directory.
Apache fails to restart. There is a syntax error in the config file. Run apache2ctl configtest (Ubuntu) or httpd -t (CentOS) to see the exact error and line number.
Shared hosting without SSH access. Contact your hosting provider and ask them to set AllowOverride All for your site directory. Most shared hosts can do this in minutes. Some hosts already have AllowOverride All enabled by default.
Frequently Asked Questions
Is this a one-time setup?
Yes. AllowOverride All persists across Apache restarts and server reboots. You only need to do this once per server.
Does AllowOverride All affect security?
AllowOverride All allows .htaccess files to override Apache directives. This is standard for WordPress and is required by most WordPress plugins that use rewrite rules (including WP Ghost, Yoast SEO, WP Rocket, and WordPress permalinks). Virtually all WordPress hosting has this enabled by default.
What if my WordPress is in a subdirectory?
Set AllowOverride All on the directory that contains your WordPress installation. For example, if WordPress is at /var/www/html/blog/, you can set AllowOverride All on /var/www/html/ (covers all subdirectories) or specifically on /var/www/html/blog/.
Does WP Ghost modify WordPress core files?
No. WP Ghost writes rewrite rules to .htaccess. AllowOverride All enables Apache to read those rules. No core files modified.
Related Tutorials
Make Sure .htaccess Is Working – verify AllowOverride All is active.
AWS Lightsail (Bitnami) Setup – AllowOverride for Bitnami stacks.
Google Cloud Platform Setup – AllowOverride for GCP.
Customize All WordPress Paths – configure paths after server setup.
Theme Not Loading Correctly – troubleshoot path issues.