got_mod_rewrite() WordPress Function

The got_mod_rewrite() function is used to check whether the mod_rewrite Apache module is enabled on the server. This function is important for Wordpress sites because it is required for the Wordpress permalink feature to work correctly.

got_mod_rewrite() #

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.


Top ↑

Source

File: wp-admin/includes/misc.php

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 {@see '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 );
}


Top ↑

Changelog

Changelog
VersionDescription
2.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.