Skip to content

Instantly share code, notes, and snippets.

@boogah
Created March 11, 2010 00:24
Show Gist options
  • Save boogah/328641 to your computer and use it in GitHub Desktop.
Save boogah/328641 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: Index.php fix
Plugin URI: http://ilikewordpress.com/loading-wordpress-from-index-php
Description: This plugin allows a blog installed at root to be addressed by /index.php. Remedies stripping of filename by includes/canonical.php
Author: Steve Johnson
Version: 1.0
Author URI: http://ilikewordpress.com/
*/
/*
* Applies filter to redirect_canonical to defeat
* stripping of index.php file
*/
function fix_index( $requested_url ) {
if ( get_bloginfo( 'url' ) == $requested_url )
return false;
}
add_filter( 'redirect_canonical', 'fix_index' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment