got_mod_rewrite(): bool

In this article

Returns whether the server is running Apache with the mod_rewrite module loaded.

Return

bool Whether the server is running Apache with the mod_rewrite module loaded.

Source

function got_mod_rewrite() {
	$got_rewrite = apache_mod_loaded( 'mod_rewrite', true );

	/**
	 * Filters whether Apache and mod_rewrite are present.
	 *
	 * This filter was previously used to force URL rewriting for other servers,
	 * like nginx. Use the 'got_url_rewrite' filter in got_url_rewrite() instead.
	 *
	 * @since 2.5.0
	 *
	 * @see got_url_rewrite()
	 *
	 * @param bool $got_rewrite Whether Apache and mod_rewrite are present.
	 */
	return apply_filters( 'got_rewrite', $got_rewrite );
}

Hooks

apply_filters( ‘got_rewrite’, bool $got_rewrite )

Filters whether Apache and mod_rewrite are present.

Changelog

VersionDescription
2.0.0Introduced.

User Contributed Notes

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