got_url_rewrite

Returns whether the server supports URL rewriting.

Description

got_url_rewrite(); 

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


Usage

  1. if ( !function_exists( 'got_url_rewrite' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/misc.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = got_url_rewrite(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/misc.php  
  1. function got_url_rewrite() { 
  2. $got_url_rewrite = ( got_mod_rewrite() || $GLOBALS['is_nginx'] || iis7_supports_permalinks() ); 
  3.  
  4. /** 
  5. * Filters whether URL rewriting is available. 
  6. * @since 3.7.0 
  7. * @param bool $got_url_rewrite Whether URL rewriting is available. 
  8. */ 
  9. return apply_filters( 'got_url_rewrite', $got_url_rewrite );