Skip to contentSkip to main navigation Skip to footer

Preventing 404 Errors After Deactivating Hide My WP Ghost Plugin

404 errors can be a frustrating experience for both website owners and visitors alike. These errors occur when a requested page is not found on the server, often leaving users stranded and confused. While this plugin is designed to have custom paths indexed in Google for good SEO, deactivating it can leave behind custom paths that need proper handling to prevent 404 errors.

Fortunately, there are steps that can be taken to prevent 404 errors after deactivating the Hide My WP Ghost plugin, especially if custom paths were utilized in Safe Mode or Ghost Mode. Below, we’ll outline solutions for both Apache and Nginx servers to handle this issue effectively.


Apache Server Solution

If your website is hosted on an Apache server, you can prevent 404 errors by adding specific rules to your .htaccess file. Follow these steps:

  1. Access Your .htaccess File: Locate and access the .htaccess file in the root directory of your WordPress installation. If you can’t find it, ensure that your FTP client or file manager is configured to display hidden files.
  2. Add Rewrite Rules: Insert the following rewrite rules at the beginning of your .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^([_0-9a-zA-Z-]+/)?core/views/(.*) /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]
</IfModule>
  1. Save and Test: Save the changes to your .htaccess file and test your website to ensure that the 404 errors have been resolved.

Nginx Server Solution

For websites hosted on Nginx servers, the solution involves adding specific rules to the nginx.conf file. Follow these steps:

  1. Access Your nginx.conf File: Locate and access the nginx.conf file on your server. This file is often found in the /etc/nginx/ directory.
  2. Add Rewrite Rules: Insert the following rewrite rules within your Nginx configuration:
if (!-e $request_filename) {
    rewrite ^/([_0-9a-zA-Z-]+/)?core/views/(.*) /wp-content/themes/$2 last;
    rewrite ^/([_0-9a-zA-Z-]+/)?storage/(.*) /wp-content/uploads/$2 last;
    rewrite ^/([_0-9a-zA-Z-]+/)?core/(.*) /wp-content/$2 last;
    rewrite ^/([_0-9a-zA-Z-]+/)?lib/(.*) /wp-includes/$2 last;
}
  1. Save and Reload Nginx: After adding the rewrite rules, save the nginx.conf file and reload Nginx to apply the changes. You can do this by running sudo systemctl reload nginx in your terminal.

Remember, if you’ve used different custom paths, be careful to modify the rewrite rules accordingly to match your specific setup.

By implementing these solutions, you can effectively prevent 404 errors on your WordPress website after deactivating custom paths set by the Hide My WP Ghost plugin.

These rules ensure that custom paths are properly handled, avoiding the frustration of broken links and improving the overall user experience. Always remember to backup your files before making any changes to your website’s configuration.