got_url_rewrite(): bool

In this article

Returns whether the server supports URL rewriting.

Description

Detects Apache’s mod_rewrite, IIS 7.0+ permalink support, and nginx.

Return

bool Whether the server supports URL rewriting.

Source

function got_url_rewrite() {
	$got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || $GLOBALS['is_caddy'] || iis7_supports_permalinks() );

	/**
	 * Filters whether URL rewriting is available.
	 *
	 * @since 3.7.0
	 *
	 * @param bool $got_url_rewrite Whether URL rewriting is available.
	 */
	return apply_filters( 'got_url_rewrite', $got_url_rewrite );
}

Hooks

apply_filters( ‘got_url_rewrite’, bool $got_url_rewrite )

Filters whether URL rewriting is available.

Changelog

VersionDescription
3.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.