Skip to content

Instantly share code, notes, and snippets.

@thomas-p-wilson
Created March 2, 2011 19:45
Show Gist options
  • Save thomas-p-wilson/851586 to your computer and use it in GitHub Desktop.
Save thomas-p-wilson/851586 to your computer and use it in GitHub Desktop.
Determines whether or not mod_rewrite is working and enabled. Meant to be added to the index page of a site where all requests are redirected to the index page.
<?php
if(!isset($_GET['rewritecheck'])) {
$headers = get_headers(ROOT_URL.'/web/?rewritecheck',1);
define('REWRITE_ENABLED',strpos($headers[0],'301') !== false);
}
if(!defined('REWRITE_ENABLED')) {define('REWRITE_ENABLED',true);}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment