got_url_rewrite() WordPress Function

The got_url_rewrite() function is used to check if the server has the ability to perform URL rewriting. This function is important because it allows WordPress to automatically generate clean permalinks for posts and pages.

got_url_rewrite() #

Returns whether the server supports URL rewriting.


Description

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


Top ↑

Return

(bool) Whether the server supports URL rewriting.


Top ↑

Source

File: wp-admin/includes/misc.php

function got_url_rewrite() {
	$got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || 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 );
}


Top ↑

Changelog

Changelog
VersionDescription
3.7.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.