got_mod_rewrite

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

Description

got_mod_rewrite(); 

Usage

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

Defined (1)

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

/wp-admin/includes/misc.php  
  1. function got_mod_rewrite() { 
  2. $got_rewrite = apache_mod_loaded('mod_rewrite', true); 
  3.  
  4. /** 
  5. * Filters whether Apache and mod_rewrite are present. 
  6. * This filter was previously used to force URL rewriting for other servers,  
  7. * like nginx. Use the {@see 'got_url_rewrite'} filter in got_url_rewrite() instead. 
  8. * @since 2.5.0 
  9. * @see got_url_rewrite() 
  10. * @param bool $got_rewrite Whether Apache and mod_rewrite are present. 
  11. */ 
  12. return apply_filters( 'got_rewrite', $got_rewrite );