Documentation

How to Set the Server Type with WPH_SERVER_TYPE in WP Hide PRO

Posted in: Getting Started (4) How To (19) Plugin Options Explained (42) Actions / Filters (35)   

WP Hide PRO automatically detects the web server type used by your WordPress website so it can generate and apply the appropriate rewrite rules. In most configurations, the plugin determines this from the $_SERVER['SERVER_SOFTWARE'] server variable.

However, some hosting environments, server configurations, reverse proxies, security layers, or custom setups may not expose this information. When the server fingerprint is unavailable, WP Hide PRO cannot determine which type of rewrite rules should be generated.

In such cases, you can manually specify the server type using the WPH_SERVER_TYPE constant.

Defining WPH_SERVER_TYPE

Add the following line to your WordPress wp-config.php file:

define( 'WPH_SERVER_TYPE', 'apache' );

The value tells WP Hide PRO which web server environment is being used, allowing the plugin to select the appropriate rewrite configuration.

The constant accepts the following values:

apache
nginx
iis

For example, for an Apache server:

define( 'WPH_SERVER_TYPE', 'apache' );

For an Nginx server:

define( 'WPH_SERVER_TYPE', 'nginx' );

For Microsoft IIS:

define( 'WPH_SERVER_TYPE', 'iis' );

The value should match the actual web server handling your WordPress installation.

When Is This Needed?

Normally, WP Hide PRO does not require any manual configuration for the server type. The plugin attempts to identify the environment automatically.

If the required $_SERVER['SERVER_SOFTWARE'] fingerprint is not available, however, the plugin cannot safely determine which rewrite syntax and rules should be used.

In that situation, WP Hide PRO displays the following message:

WP Hide Unable to identify server type!
No rewrite is being applied.

This is a protection mechanism. Applying rewrite rules designed for the wrong server could result in incorrect URL processing or unexpected website behavior, so the plugin does not proceed without knowing the server environment.

Manually Selecting the Correct Server

Adding WPH_SERVER_TYPE provides WP Hide PRO with the missing information.

For example, if the website is running on Apache but the server software information is hidden:

define( 'WPH_SERVER_TYPE', 'apache' );

After this constant is defined, WP Hide PRO can use the specified server type when processing its rewrite configuration.

The constant is particularly useful on hosting environments where the server is located behind a reverse proxy, load balancer, firewall, CDN, or another layer that prevents the original server software information from being exposed through $_SERVER['SERVER_SOFTWARE'].

Where to Add the Constant

The definition should be placed in the main wp-config.php file, before WordPress finishes loading.

For example:

define( 'WPH_SERVER_TYPE', 'nginx' );

/* That's all, stop editing! Happy publishing. */

Only define the constant when necessary or when you intentionally want to override automatic server detection. Make sure the selected value accurately reflects the server responsible for handling the rewrite rules.

By explicitly setting WPH_SERVER_TYPE, WP Hide PRO can identify the correct rewrite environment even when automatic server detection is unavailable.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Scroll to top